• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

why JVM different?

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
java is platform indipendent. Why JVM is different for windows,unix & etc.
------------------
 
Ranch Hand
Posts: 4716
9
Scala Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Randall,
Java is platform independent, but not browser independent!
Manfred.
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
reply
    Bookmark Topic Watch Topic
  • New Topic