wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Java Compiler and JVM are platform dependent or independent? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic
Author

Java Compiler and JVM are platform dependent or independent?

sujitha reddy
Greenhorn

Joined: Oct 20, 2006
Posts: 15
Java Compiler and JVM are platform dependent or independent? if they are independent how?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61092
    
  66

Not a servlet question. Moved to Java in general.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> Java Compiler and JVM are platform dependent or independent?

from the downloads page

http://java.sun.com/javase/downloads/ea.jsp

click the [Download] button next to JDK6 Beta 2, for your answer
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Please don't post the same question to more than one forum. See here for an explanation of why I just deleted the other copy of this thread.


[Jess in Action][AskingGoodQuestions]
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

First, you would have to precisely define the term "platform independent." Then, given that definition, your question could be answered. But just asking whether something is "platform independent" without explaining what that means to you just starts an argument between people who don't realize that there are different ways to define this term.

So if you want a sensible answer, you have to refine your question further.
Nitin Jain
Greenhorn

Joined: Oct 24, 2006
Posts: 4
Java Compiler and JVM are independent of each other, Java Compiler and JVM both are platform dependent.

Java Compiler - this is used to convert java program in the form of "Byte Code" that is nothing but class file and this compiler is coming different for different platform (windows, linux etc) so this is plateform dependent.

JVM - Use to run "Byte Code", this byte code is common for all the plateform, because all the compiler converts java code into the byte code that is common for all, and JVM can understand only byte code and can run this byte code on any platform, but again you required compitable JVM for that plateform.

Result - both Java Compiler and JVM are platform dependent but Java Applications are platform independent, because you can take byte code(.class file) to any other platform and can run using JVM.
Vlado Zajac
Ranch Hand

Joined: Aug 03, 2004
Posts: 245
Sun's java compiler is written in Java and so it is platform independent in the same way as other Java programs. (Only the JVM and launcher program are platform dependent).

Other compilers may not be written in Java.
Jobin Mathew
Ranch Hand

Joined: Oct 17, 2006
Posts: 83
Java Compiler and JVM both are platform dependent.
Only the byte code (class file) generated by Compiler is platform independent.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Mmmkay, that'll be enough nattering for now.
 
jQuery in Action, 2nd edition
 
subject: Java Compiler and JVM are platform dependent or independent?