Skip to content

The JVM(I)

Posted on:March 22, 2023 at 02:21 PM
Share on

Oracle has two products that implement Java Platform Standard Edition (Java SE) 8: Java SE Development Kit (JDK) 8 and Java SE Runtime Environment (JRE) 8. JDK 8 is a superset of JRE 8, and contains everything that is in JRE 8, plus tools such as the compilers and debuggers necessary for developing applets and applications. JRE 8 provides the libraries, the Java Virtual Machine (JVM), and other components to run applets and applications written in the Java programming language. Note that the JRE includes components not required by the Java SE specification, including both standard and non-standard Java components. The following conceptual diagram illustrates the components of Oracle’s Java SE products: Description of Java Conceptual Diagram

Java Platform Standard Edition 8 Documentation

Table of contents

Open Table of contents

Java 平台标准(JDK 8)

关于 JDK、JRE、JVM 之间是什么关系,在 Java 平台标准中已经明确定义了。 也就是上面的英文介绍部分。

JDK 是什么?

JDK 是 JRE 的超集,JDK 包含了 JRE 所有的开发、调试以及监视应用程序的工具。以及如下重要的组件:

JRE 是什么?

JRE 本身也是一个运行在 CPU 上的程序,用于解释执行 Java 代码。一般像是实施的工作,会在客户现场安装 JRE,因为这是运行 Java 程序的最低 要求。

JVM 是什么?

其实简单说 JVM 就是运行 Java 字节码的虚拟机,JVM 是一种规范,各个供应 商都可以实现自己 JVM 虚拟机。JVM 之所以称为虚拟机,主要就是因为它为了实现 “write-once-run- anywhere”。提供了一个不依赖于底层操作系统和机器硬件结构的运行环境。

Client 模式、Server 模式

在 JVM 中有两种不同风格的启动模式, Client 模式、Server 模式。

修改配置模式文件:C:\Program Files\Java\jre1.8.0_45\lib\amd64\jvm.cfg

# List of JVMs that can be used as an option to java, javac, etc.
# Order is important -- first in this list is the default JVM.
# NOTE that this both this file and its format are UNSUPPORTED and # WILL GO AWAY in a future release.
#
# You may also select a JVM in an arbitrary location with the
# "-XXaltjvm=<jvm_dir>" option, but that too is unsupported
# and may not be available in a future release.
#
-server KNOWN
-client IGNORE

如果需要调整,可以把 client 设置为 KNOWN,并调整到 server 前面。

JVM

JVM

JVM 结构和执行器

Share on