This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

why JVM different?

 
ravi_be
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java is platform indipendent. Why JVM is different for windows,unix & etc.
------------------
 
Randall Twede
Ranch Hand
Posts: 4371
3
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ravi_be,
java is not as platform independent as we would like to believe. I wrote an applet that only works right in IE but not in Netscape. No one can figure out why either.
I hate to say this but, your name does not comply with the Javaranch naming guidelines which can be found at http://www.javaranch.com/name.jsp
please register again with a valid name.
In particular, you need two names seperated by a space.
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Randall,
Java is platform independent, but not browser independent!
Manfred.
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The reason that Java is platform independent is the very reason that the JVM's need to be unique for each OS.
If you buy a printer, there is a printer driver that you need to install. This printer driver is the communication link between the printer and the operating system. It stands to reason that the driver's "printer-side" face is always the same, but the face that is "Operating System-side" will be different for every OS. One driver for Macs, one driver for Linux, one for Windows.

JVM's are exactly like printer drivers, only they allow a Java program to talk to the OS. So if you want to run a java program, the JVM's "Java-side" face is always the same, but the face for the "OS-side" must be different.

In Java bytecode, "System.out.println" is (probably) the same on every platform, and therefore the "Java-side" face to the JVM needs to understand only one way of receiving this command. But on the "OS-side" face, the operating system determines how you go about showing text. (or printing it out, or turning it into spoken word, etc...)

Does that help?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic