Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JVM doubt  RSS feed

 
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: 1558
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
Sheriff
Posts: 16028
87
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: 1558
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
Marshal
Posts: 55687
163
  • 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.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!