Hi Just curious to know when java is made platform independent then are there any specific reasons JVM is made platform dependent..
views:
315answers:
5The 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.
The JVM must be platform dependent to allow your Java to run on the specific platform. A JVM for Windows will translate your Java into different system calls than a JVM for OS X.
Because there needs to be some way to convert the platform-independent application's Java calls to calls that are compatible with the underlying OS.
Unless you have a CPU that can directly execute Java bytecode (there are such things) you need to be able to interact with the OS (for things like reading files, connecting to the network, displaying to the screen, etc...).
You can write a JVM in other languages (such as Java or JavaScript) but ultimately there needs to be something that can interact with the underlying OS.