why java is platform independent and jvm is platform dependent?

JVM is a virtual machine or a program that provides run-time environment in which java byte code can be executed. JVM needs to be installed on your machine depending on what platform do you have and what version of it. JVMs are available for many hardware and software platforms. JVM, JRE and JDK are platform dependent because configuration of each OS differs.

The use of the same byte code for all JVMs on all platforms make java platform independent. Or java is platform independent because java does not run directly on operating system. It runs on the JVM which you have to install separately.

Please follow and like us:
Content Protection by DMCA.com