Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is the JVM not platform independent, given that Java (the language) is platform independent?

Tags:

java

jvm

Just curious to know when java is made platform independent then are there any specific reasons JVM is made platform dependent..

like image 471
giri Avatar asked Jan 22 '10 21:01

giri


People also ask

Why Java is platform independent but not JVM?

And the answer would be, it's because of the JVM. The byte code generated by source code compilation would run in any operating system, but the JVM present in a machine differs for each operating system. And this is how java is considered a platform-independent programming language.

What is JVM why Java is called platform independent language?

This bytecode is sent to Java virtual machine (JVM) which resides in the RAM of any operating system. JVM recognizes the platform it is on and converts the bytecodes into native machine code. Hence java is called platform independent language.

What is JVM is it platform independent or not?

Java is platform-independent but JVM is platform dependent In Java, the main point here is that the JVM depends on the operating system – so if you are running Mac OS X you will have a different JVM than if you are running Windows or some other operating system.


1 Answers

The JVM executes Java code, but is written in platform specific languages such as C/C++/ASM etc. The JVM is not written in Java and hence cannot be platform independent.

like image 101
Chris Kannon Avatar answered Nov 16 '22 03:11

Chris Kannon