Totally Confused with java.exe

后端 未结 3 799
一向
一向 2020-11-28 15:15

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

相关标签:
3条回答
  • 2020-11-28 16:09

    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.

    0 讨论(0)
  • 2020-11-28 16:14

    @karthik4621 java.exe/javaw application is part of JRE look into the JRE installation directory to find bin folder, to find the executable's and the java.exe you find bundled along with JDK is also same :) for more insight on the issue i suggest you read through oracle docs as well as the quick brush up of contents of the JDK/JRE install locations –

    0 讨论(0)
  • 2020-11-28 16:18

    you are right java.exe is the interpreter for JVM (java virtual machine) and JVM is where your code gets executed by communicating with the underlying OS

    0 讨论(0)
提交回复
热议问题