-
Java Virtual Machine
Hello
I have a question about the Java Virtual Machine.
Please correct any misunderstandings that I may have.
When you write a java program, it is first compiled using javac and the result
is a .class file which contains the byte code. Now you can run this program
using java <filename.class> and this 'runs' the bytecode file (.class file)
and your program is run.
My question is : where does the Java Virtual Machine feature in this. Is
the java program the JVM that inteprets the byte code and runs the program.
If not then how does the JVM fit in to the whole picture.
Also, can a java program be run interpreted and from an executable. What
are the major differences between these.
Please excuse my ignorance but I am trying to get a conceptual understanding
of Java.
Thanking you for your help,
Raj
-
Re: Java Virtual Machine
Yes, basically the "java" program is the JVM. A Java class must be run by a
JVM; it can't be executed on its own. Since Java is platform independent,
there must be something outside of Java that sits between the class you
produced and the operating environment you are running it in; that's what
the JVM is for.
Raj <jstudent01@hotmail.com> wrote in message
news:38f49c7f$1@news.devx.com...
>
> Hello
>
> I have a question about the Java Virtual Machine.
>
> Please correct any misunderstandings that I may have.
>
> When you write a java program, it is first compiled using javac and the
result
> is a .class file which contains the byte code. Now you can run this
program
> using java <filename.class> and this 'runs' the bytecode file (.class
file)
> and your program is run.
>
> My question is : where does the Java Virtual Machine feature in this. Is
> the java program the JVM that inteprets the byte code and runs the
program.
> If not then how does the JVM fit in to the whole picture.
>
> Also, can a java program be run interpreted and from an executable. What
> are the major differences between these.
>
> Please excuse my ignorance but I am trying to get a conceptual
understanding
> of Java.
>
> Thanking you for your help,
>
> Raj
>
-
Re: Java Virtual Machine
I posted my response wrong. Please see my response in this category. It's
called, "Java's Role In The Thing". Bye.
"Raj" <jstudent01@hotmail.com> wrote:
>
>Hello
>
>I have a question about the Java Virtual Machine.
>
>Please correct any misunderstandings that I may have.
>
>When you write a java program, it is first compiled using javac and the
result
>is a .class file which contains the byte code. Now you can run this program
>using java <filename.class> and this 'runs' the bytecode file (.class file)
>and your program is run.
>
>My question is : where does the Java Virtual Machine feature in this. Is
>the java program the JVM that inteprets the byte code and runs the program.
>If not then how does the JVM fit in to the whole picture.
>
>Also, can a java program be run interpreted and from an executable. What
>are the major differences between these.
>
>Please excuse my ignorance but I am trying to get a conceptual understanding
>of Java.
>
>Thanking you for your help,
>
>Raj
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks