File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes JVM doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "JVM doubt" Watch "JVM doubt" New topic

JVM doubt

Anu satya
Ranch Hand

Joined: Mar 17, 2005
Posts: 146
I have learnt that on compilation of a java code, it is converted into bytecode (.class file) and this .class file is used by JVM to execute on different OS / platforms.

so, should there be different types of JVMs specific to different OS ? or is there only one JVM for all the OS / platforms?

can anyone please clarify my doubt?

With Regards,
Bupjae Lee
Ranch Hand

Joined: May 14, 2007
Posts: 107
JVM should interpret (or compile) your platform-independent bytecode to platform-dependent native code.

Therefore each platform uses their own JVM.
swapnl patil
Ranch Hand

Joined: Aug 13, 2007
Posts: 80
JVM is OS dependent, different OS has different JVM thats why Java Is platform independent.

same thing for .Net CLR is different for differnet OS.
Anu satya
Ranch Hand

Joined: Mar 17, 2005
Posts: 146
Thank you Patil and Lee,
Thank you very much.

r suraaj

Joined: Oct 26, 2008
Posts: 16
in order to execute the .class files JVM is enough ? or there should be any other components in jre required in addition to jvm?

and one more doubt is .,

in general ., in mobile devices only jvm is installed or jre is installed ?
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
See #18 in the JavaBeginnersFaq. A JVM by itself is not sufficient to execute Java code.
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46337
Try this link about mobile devices, and see whether it answers your question. Don't know myself.
I agree. Here's the link:
subject: JVM doubt
It's not a secret anymore!