This post explains the most relevant concepts around the software needed to run and/or compile Java in a computer. Java Virtual Machine Java Virtual Machine (JVM) is the virtual machine that runs the Java bytecodes. The JVM doesn’t understand Java source code; that’s why you need compile your *.java files to obtain *.class files that […]
Tag Archives | runtime
How to call native code from a Java application
Methods to call a native function Method 1. Use Runtime class Runtime class contains the exec method that allows the application to run an operating system command. An example of how to use this method: String command = “echo \”Hello World!\”"; Runtime.getRuntime().exec(command); Method 2. Use JNI Java Native Inteface (JNI) is […]