Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
900 views
in Technique[技术] by (71.8m points)

jvm - Totally Confused with java.exe

The JDK is the superset of JRE. JDK has the necessary tools like javac java.exe debugger etc + JRE. But JRE has a particular implementation of JVM.

My assumption is java.exe or the java application launcher is the interpreter (please correct me if I'm wrong). Also, JVM does the interpretation as well.

Finally is the interpreter part of JVM or part of JDK tools? Please explain.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

java.exe is neither a JVM nor an interpreter. It is a launcher - a small program typically written in C which does the following:

  1. Locates an installed JRE
  2. Loads JVM dynamic library (jvm.dll)
  3. Creates a new Java Virtual Machine using the Invocation API
  4. Finds the main class and calls the main() method using JNI

JRE roughly consists of

  1. JVM - jvm.dll
  2. Class Library - rt.jar
  3. Native libraries - the layer between the class library and the OS platform, e.g. java.dll, net.dll, nio.dll, awt.dll etc.
  4. Resources - fonts, properties, strings etc.

Now, the Bytecode Interpreter, the Bytecode Verifier, the Class Loader, the JIT compiler, the Garbage Collector and many other cool stuff - are all parts of the Java Virtual Machine.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...