• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

How do we explain this in simple words - Why is the JVM dependent on each OS ?

 
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A JVM is dependent on the OS it is meant for. What are the reasons for that ? I feel that we need to know what makes an OS different from the other, besides the GUI.
I don't know anything about OSes (have an orcale cert, but almost no CS knowledge), but i heard a word called architecture of an OS. Is that one of the reasons why the JVM is platform dependent ?

 
Ranch Hand
Posts: 34
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Java compiler is platform independent. Compiler just convert java code into byte code.

JVM is platform dependent because
1. it must convert the byte code into machine language.
2. executes the corresponding machine-language instructions as well.

Machine instructions are different for different platforms. So different platforms need different JVM. So JVM is platform dependent
 
Andy Jack
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Suresh Sajja wrote:Java compiler is platform independent. Compiler just convert java code into byte code.

JVM is platform dependent because
1. it must convert the byte code into machine language.
2. executes the corresponding machine-language instructions as well.

Machine instructions are different for different platforms. So different platforms need different JVM. So JVM is platform dependent



Can you also give me the source of this information - like maybe a book or a well known website ?
 
Marshal
Posts: 27211
87
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Basically you're asking for an explanation of why you can't run a Windows executable on a Mac.

Most people realize that is the case, even though they don't have any Computer Science background either. But most people don't require an explanation, they accept it as a fact.
 
Ranch Hand
Posts: 86
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Andy Jack wrote:Can you also give me the source of this information - like maybe a book or a well known website ?


You're poking into the architecture of the machine/processor now. Of course there are many differences between various platforms. To wit:

Every processor or processor family has its own machine code instruction set. Instructions are patterns of bits that by physical design correspond to different commands to the machine. The instruction set is thus specific to a class of processors using (much) the same architecture. Successor or derivative processor designs often include all the instructions of a predecessor and may add additional instructions.



From http://en.wikipedia.org/wiki/Machine_code

Just google "machine code platform" and you will get all the hits you need, but it will be very arcane and not at all related to the high level languages we use. So it's not so much OS dependent as platform architecture dependent (which registers are at which addresses and how to talk to them, etc.)

 
I’m tired of walking, and will rest for a minute and grow some wheels. This is the promise of this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic