Java Virtual Machine


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Java Virtual Machine

  1. #1
    Raj Guest

    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


  2. #2
    Paul Clapham Guest

    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
    >




  3. #3
    DavidB Guest

    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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center