-
Java VM's role in the thing
in java there's 3 levels of operation you can distinguish regarding this example.
your code would be the first: that's the .java file you type. second would
be the compiled version of that file, the .class file, also refered to as
bytecode. the bytecode is useless to your machine until it is converted
into your processor's native assembly language. the Java Virtual Machine
converts that in realtime (hence some complaints that java is still not as
fast as some non-platform-independent languages, C and C++ usually). the
likes of C++ are languages without VM's, so they have only 2 levels of operation
regarding this example. but the VM intermediary step is what opens up java's
write-once, run-anywhere ability. the VM is actually a program which is
not platform-independent. it must be written and compiled for a specific
processor, so Intel, SPARC, and Motorola all have different VM's, for example.
happy coding.
-
Re: Java VM's role in the thing
Hi David
Thank your for your response. It certainly clears the picture. However, I
do have one question.
According to your reply, it means that each environment has it's own JVM
and that your code would first be compiled to bytecode and then 'run' by
the JVM.
Can you create a .exe program file in Java. If so, how would you run this
program as platform independent on different environments or must you only
run the program as a .class file from the JVM.
Thanking you for your kind advise
Raj
"DavidB" <db@inctools.com> wrote:
>
>in java there's 3 levels of operation you can distinguish regarding this
example.
> your code would be the first: that's the .java file you type. second would
>be the compiled version of that file, the .class file, also refered to as
>bytecode. the bytecode is useless to your machine until it is converted
>into your processor's native assembly language. the Java Virtual Machine
>converts that in realtime (hence some complaints that java is still not
as
>fast as some non-platform-independent languages, C and C++ usually). the
>likes of C++ are languages without VM's, so they have only 2 levels of operation
>regarding this example. but the VM intermediary step is what opens up java's
>write-once, run-anywhere ability. the VM is actually a program which is
>not platform-independent. it must be written and compiled for a specific
>processor, so Intel, SPARC, and Motorola all have different VM's, for example.
> happy coding.
-
Re: Java VM's role in the thing
But .exe program files _aren't_ platform independent. They only run in
Microsoft environments. Java .class files, however, _are_ platform
independent and can be run on any system that has a JVM. For example, I
have a package of .class files that were originally written on a UNIX system
and are now in production on my AS/400 system.
Raj <jstudent01@hotmail.com> wrote in message
news:38fb404d$1@news.devx.com...
>
> Hi David
>
> Thank your for your response. It certainly clears the picture. However, I
> do have one question.
>
> According to your reply, it means that each environment has it's own JVM
> and that your code would first be compiled to bytecode and then 'run' by
> the JVM.
>
> Can you create a .exe program file in Java. If so, how would you run this
> program as platform independent on different environments or must you only
> run the program as a .class file from the JVM.
>
> Thanking you for your kind advise
>
> Raj
>
> "DavidB" <db@inctools.com> wrote:
> >
> >in java there's 3 levels of operation you can distinguish regarding this
> example.
> > your code would be the first: that's the .java file you type. second
would
> >be the compiled version of that file, the .class file, also refered to as
> >bytecode. the bytecode is useless to your machine until it is converted
> >into your processor's native assembly language. the Java Virtual Machine
> >converts that in realtime (hence some complaints that java is still not
> as
> >fast as some non-platform-independent languages, C and C++ usually). the
> >likes of C++ are languages without VM's, so they have only 2 levels of
operation
> >regarding this example. but the VM intermediary step is what opens up
java's
> >write-once, run-anywhere ability. the VM is actually a program which is
> >not platform-independent. it must be written and compiled for a specific
> >processor, so Intel, SPARC, and Motorola all have different VM's, for
example.
> > happy coding.
>
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