Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JVM doubt

 
saloni jhanwar
Ranch Hand
Posts: 583
Firefox Browser Notepad Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Windows XP and jdk 1.7 is installed on it.Now i want to that when JVM does load in my computer ? It does load automatically when my computer starts or it loads when i use javac and java command to run my java program ? and When JVM does unload ?
 
Anayonkar Shivalkar
Bartender
Posts: 1557
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JVM is started (or loaded) during actual execution of a Java program. That is, whenever java.exe(or java in case of Linux) is executed, JVM is started. When execution of java.exe ends, JVM ends and so on.

Please note that JVM is not required during compilation (i.e. javac command).
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15207
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anayonkar Shivalkar wrote:Please note that JVM is not required during compilation (i.e. javac command).

The Java compiler included with the JDK (javac) is itself written in Java for the largest part, so it does need a JVM to run.
 
Anayonkar Shivalkar
Bartender
Posts: 1557
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jesper de Jong wrote:The Java compiler included with the JDK (javac) is itself written in Java for the largest part, so it does need a JVM to run.

Yes. However, our code does not run there - that is, our classes won't be loaded and so on.

Anyways, I missed this part - JVM is required during compilation as well, so it will be loaded during javac as well.

Apologies for wrong info.
 
Campbell Ritchie
Sheriff
Posts: 48415
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a Java Language Specification (JLS) section all about that. The JLS is by no means easy to understand, however.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic