0

The JVM is defined as: The JVM is the ‘virtual machine’ that runs the Java bytecodes.
Isn't that what the 'java' executable provided in the JDK does?
Or is the JVM some other executable? If yes, then which one(s)?
Or have I got the concept entirely wrong, and the JVM is not associated with any executable in any way?

John Red
  • 695
  • 1
  • 11
  • 16
  • possible duplicate of [Totally Confused with java.exe](http://stackoverflow.com/questions/26020872/totally-confused-with-java-exe) – apangin Oct 21 '14 at 22:47

1 Answers1

1

The JVM is defined as: The JVM is the ‘virtual machine’ that runs the Java bytecodes.

Isn't that what the 'java' executable provided in the JDK does?

In effect, yes. You can think of the java executable as a "front end" or "launcher" for the JVM: you give it the name of an entry class, and it kicks off a JVM instance and executes the that class's main method. You could host a JVM instance in your own application using a hosting API, but the java executable is the de facto way to spool up a JVM instance for the purpose of running a specific Java program.

There are also applications which 'bootstrap' the JVM: they are Java applications that have their own platform-dependent "launcher", which lets them behave more like native applications, in that you can run them directly instead going through the java executable. Many of the Java compiler tools are packaged this way (e.g., javac, javap) as are many Java IDEs (e.g., IntelliJ, Eclipse, etc.).

Community
  • 1
  • 1
Mike Strobel
  • 25,075
  • 57
  • 69