简体   繁体   English

完全与java.exe混淆

[英]Totally Confused with java.exe

The JDK is the superset of JRE. JDK是JRE的超集。 JDK has the necessary tools like javac java.exe debugger etc + JRE. JDK具有必要的工具,例如javac java.exe调试器等+ JRE。 But JRE has a particular implementation of JVM. 但是JRE具有JVM的特定实现。

My assumption is java.exe or the java application launcher is the interpreter (please correct me if I'm wrong). 我的假设是java.exe或Java应用程序启动器是解释器(如果我错了,请纠正我)。 Also, JVM does the interpretation as well. 同样,JVM也进行解释。

Finally is the interpreter part of JVM or part of JDK tools? 最后,解释器是JVM还是JDK工具的一部分? Please explain. 请解释。

java.exe is neither a JVM nor an interpreter. java.exe既不是JVM也不是解释器。 It is a launcher - a small program typically written in C which does the following: 它是一个启动器 -通常用C编写的一个小程序,它执行以下操作:

  1. Locates an installed JRE 找到已安装的JRE
  2. Loads JVM dynamic library ( jvm.dll ) 加载JVM动态库( jvm.dll
  3. Creates a new Java Virtual Machine using the Invocation API 使用调用API创建新的Java虚拟机
  4. Finds the main class and calls the main() method using JNI 查找主类并使用JNI调用main()方法

JRE roughly consists of JRE大致包括

  1. JVM - jvm.dll JVM- jvm.dll
  2. Class Library - rt.jar 类库rt.jar
  3. Native libraries - the layer between the class library and the OS platform, eg java.dll , net.dll , nio.dll , awt.dll etc. 本机库-类库和OS平台之间的层,例如java.dllnet.dllnio.dllawt.dll等。
  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. 现在,字节码解释器,字节码验证器,类加载器,JIT编译器,垃圾收集器和许多其他很酷的东西-都是Java虚拟机的组成部分。

@ karthik4621 java.exe / javaw应用程序是JRE的一部分,进入JRE安装目录以查找bin文件夹,以查找可执行文件,并且您发现与JDK捆绑在一起的java.exe也相同:)以获得关于该问题的更多见解建议您通读oracle文档以及快速了解JDK / JRE安装位置的内容–

没错,java.exe是JVM(Java虚拟机)的解释器,而JVM是通过与底层操作系统进行通信来执行代码的地方

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM