why JVM is platform dependent ?where as java language is platform independent as it is said then?

25th Jul 2016, 2:51 PM
Bssk Chaitanya
Bssk Chaitanya - avatar
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.
25th Jul 2016, 3:06 PM
Valentino Picone
Valentino Picone - avatar
I agree. the .class file it self is platform independent (you don't have to compile the .java file for every system)
26th Jul 2016, 2:57 PM
No One
No One - avatar
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
8th Jun 2017, 7:01 AM
Dell Mercant
Dell Mercant - avatar
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 .
23rd Mar 2019, 3:42 AM
anjali jain
anjali jain - avatar