Re: Java platform independent.what is a platform?
Posted By:
David_Bates
Posted On:
Tuesday, April 8, 2003 01:48 AM
You've got a point. "Platform" is an over-used term, like "system". A few points:
"A processor has its own instruction set that is different from that of other processors.An executable code on one processor doesn't run on another processor,whatever may be the operating system."
Not quite true. You have families of processors e.g. x86, which allow for legacy code to be run.
"My question is: consider two platforms: Intel Pentium+MS Windows. and AMD Athlon+MS Windows. Is the same JVM used for both these platforms?"
Yes. You can see this if you download the JRE from Sun's website. HOWEVER, there would be nothing to stop you from writing an Athlon-optimised JVM (I'm sure people have done this).
The following diagram might help:
Java Byte Code -> Java Virtual Machine -> Operating System -> Processor
The Story: Java byte code is taken from the class files and fed into the vitual machine. The virtual machine then makes calls to the operating system to fulfill the behaviour of the virtual machine, as specified by Sun. The operating system then itself receives these calls, which are then mapped to calls to the processor. The way in which these operating system calls execute on the processor is dependent upon the operating system e.g. Hardware Abstraction Layer, Processor Optimizations etc.