Every Java program is compiled into an intermediate language called Java bytecode. The JVM is used to both translate the bytecode into the machine language for a particular computer, and actually execute the corresponding machine-language instructions as well. The JVM and bytecode combined give Java its status as a "portable" language.
Given the previous information, it should be easier to deduce an answer to the question. Since the JVM must translate the bytecode into machine language, and since the machine language depends on the operating system being used, it is clear that the JVM is machine dependent. This fact can be verified by trying to download the JVM - you will be given a list of JVM's corresponding to different operating systems, and you will obviously pick whichever JVM is targeted for the operating system that you are running.
there are two tools which is for compliling and running java programs
javac - it is compiler which converst java source code to byte code ie.class file. This byte code is standard for all platforms, machines or operating systems.
java - this is interpreter. this interprets the .class file based on a particular platform and excutes them.e jvm -> java virtual machine comes into play. jvm for windows will be different from jvm for solarais or linux . but all the jvm take the same byte code and executes them in that platform.
Source code -> javac ->Universal byte code
Universal byte ->jvm/java -> execute them on a particular machine.
There can be any number of jvm's but they all understand the one common language called byte code and translates them into the binary executable of a particular platform for which they are developed. There is separate development section in sun microsystems is to develop the jvm f or a particular platform.
for each upgrade of the jdk , the jvm for each platform is updated.
No comments:
Post a Comment