Just curious to know when java is made platform independent then are there any specific reasons JVM is made platform dependent..
15 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.
5 Comments
mmap the VM image, write the mmapped address into a specific location into the image and then jumps into a predefined location inside the image. The second place is the debugger: Maxine uses the platform's native debugging facilities, and the reason why they are written in C is because they are ripped from GDB, because the platform documentation is simply too horrible to write a debugger from scratch. And three is the very low-level threading code: Maxine uses native threads.I found that this was a great answer to the question:
JVM translates bytecode into machine language
Every Java program is compiled into an intermediate language called Java bytecode. 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. The JVM and bytecode combined give Java its status as a "portable" language.
Machine language is OS dependent
Given the previous information, it should be easier to deduce an answer to the question. Since the JVM must translate the bytecode into machine language, and since the machine language depends on the operating system being used, it is clear that the JVM is platform (operating system) dependent. This fact can be verified by trying to download the JVM – you will be given a list of JVM’s corresponding to different operating systems, and you will obviously pick whichever JVM is targeted for the operating system that you are running.
Quoted from Is the JVM Platform Dependent?
Comments
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.
Comments
No, JVMs are not platform independent. In fact they are platform specific run time environment provided by the vendor. Each platform (Windows, UNIX, Mac etc) has its own JVM to run Java applications. Although the byte code supports connection to multiple databases..
Think of Music being played in a MP3 player, CD player and old faithful cassette players(Boom Box). The output is always the same, ie music. But the input (media ie .mp3 files for MP3 Players, CDs for CD Players and cassettes for Cassette Players) vary depending on the system [here the systems will be the various Operating Systems like Windows, UNIX, Mac etc..]. Hope i was able to solve your problem..
Comments
The JVM is not platform independent
The key 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. This fact can be verified by trying to download the JVM for your particular machine – when trying to download it, you will be given a list of JVM’s corresponding to different operating systems, and you will obviously pick whichever JVM is targeted for the operating system that you are running.
Comments
Hope this image can make it clear. When you install java on your machine, you are asked to select your OS. That means java to be installed on a Windows machine is not the same as the one on a mac. Java installation comes with JDK, JRE, and JVM that are OS-specific.
JDK has a compiler that converts your Java code to bytecode and bytecode is platform-independent. JVM can read this bytecode and using an interpreter convert them to OS-specific instructions which vary based on your OS.
All JDK, JRE, and JVM are platform-dependent. But JAVA is platform-independent because bytecode is platform-independent.
Comments
simply like - * - makes a +.
We all know Java is platform independent
but OS where we write the code is platform dependant
and Output should be platform independent so, we make jvm (which is in-between and installed with jre) platform dependent so that the output is independent.
1 Comment
No, JVM is platform dependent. The code written in Java is not platform dependent. If you write Java code on a Windows operating system you can run that code on Linux or other operating Systems. But the JVM for Windows and Linux is different. JVM are found in JRE and when you download JRE from Oracle it says JRE for Window, Linux and other operating systems

realquestion in there (even though the answer may seem obvious at first sight to some).