0
why JVM is platform dependent ?where as java language is platform independent as it is said then?
4 Answers
+ 1
Well, because JVM needs to translate java code to machine code and machine code is strictly related with the platform. It changes by cpu to cpu and OS to OS. So, jvm translates a unique programming language (java) into multiple machine languages.
You only need to have a jvm on the platform (the installation of it will configure the vm properly for the platform).
Hope it was clear, as it's the first time I try to explain it in English.
0
I agree. the .class file it self is platform independent (you don't have to compile the .java file for every system)
0
The JVM is not platform independent. Java Virtual Machine (JVM) provides the environment to execute the java file(. Class file). So at the end it's depends on your kernel , and kernel is differ from OS (Operating System) to OS. 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. Without the JVM, you canât run a Java application.
More..
http://net-informations.com/java/cjava/independent.htm
0
Java is platform independent because .class file only ready by JVM ,here is no role of OS of System and JVM is platform dependent because every OS have different configuration so they require different JVM .