JDK, JVM, JRE in the Java environment
Recently underestimated Android, a bunch of concepts jdk, JVM, JRE, SDK, NDK, ADT. The JDK, the JVM, the JRE are things in the Java environment, and the SDK, NDK, and ADT are the things that Android develops. Here's a distinction between the JDK, the JVM, and the JRE.
Tip: After the Mac installed Java, where it is, see the following figure
First, the JDK
The JDK (Java Development Kit) is the Java Language Software Development Kit (SDK).
The JDK is the core of the entire Java system, including the Java Runtime Environment (Java Runtime envirnment), a stack of Java tools (Javac/java/jdb, and so on) and a Java-based class library (that is, the Java API).
There are three versions of the following:
SE (J2SE), Standard Edition, Standard Edition, is our usual version, starting with JDK 5.0, renamed Java SE.
EE (Java EE), Enterprise Edition, Enterprise Edition, uses this JDK to develop the EE application, starting with JDK 5.0, and renaming it as Java-based EE.
Me (J2ME), Micro Edition, primarily for mobile devices, Java applications on embedded devices, starting with JDK 5.0, renamed Java ME.
Let's talk about the JRE again.
The JRE is the abbreviation for Java Runtime Environment, and the Java Runtime environment (including Java Plug-in) is Sun's product, including two parts: Java Runtime environment and Java Plug-in. The Javaruntimeenvironment (JRE) is the Java platform on which applications can be run, tested, and transferred. It includes Java virtual machines (JVMS), Java Core class libraries, and supporting files. It does not contain development tools (JDK)-compilers, debuggers, and other tools. The JRE requires assistive software--java plug-in--to run applets in the browser.
Java programs cannot be compiled without JDK, but can run programs on systems that have JRE environments. So when you just need to run a Java program or applet, download and install the JRE. If you want to develop your own Java software, please download the JDK.
Finally, let's take a look at the JVM.
The JVM is Java virtual Machine (Java VM), the JVM is a specification for computing devices, it is a fictitious computer, is realized by simulating various computer functions on the actual computer.
A very important feature of the Java language is the independence of the platform. The use of Java virtual machines is the key to achieving this feature. In general, high-level languages need to be compiled into different target codes if they are to run on different platforms. When the Java language virtual machine is introduced, the Java language does not need to be recompiled when it runs on different platforms. The Java language uses Java virtual machines to mask information related to specific platforms, allowing the Java language compiler to generate only the object code (bytecode) that runs on the Java Virtual machine, which can be run unmodified on a variety of platforms. When executing bytecode, the Java Virtual Machine interprets the bytecode as a machine instruction execution on a specific platform. This is the reason Java can "compile, run everywhere".
This is the diagram of the three:
We developed the fact that we used the JDK (Invoke Java API) to develop our own Java program, compile our text Java files into Java bytecode via the JDK compiler (JAVAC), and run these Java bytecode on the JRE, The JVM resolves these bytecode, mapping to a CPU instruction set or system call to the OS.
JVM (Java Virtual Machine), Java VM
The JVM masks information related to the specific operating system platform so that Java programs can run on a variety of platforms without modifying the object code (bytecode) that runs on the Java virtual machine. When the JVM executes bytecode, it actually eventually interprets the bytecode as machine instruction execution on a specific platform. Compiling a set of instructions for a virtual machine is very similar to compiling a microprocessor's instruction set.
The JVM is the basis of the Java language Cross-platform (where the "platform" refers to different operating systems), and to run Java programs on different operating systems, you need to install the corresponding JVM on different operating systems. So, the JVM has Windows version, Mac version, Linux version, and so on.
JRE (Java Runtime Environment), Java Runtime Environment
JRE includes the core class libraries required by Java virtual machines and Java programs. If you want to run a well developed Java program, just install the JRE on your computer.
Summary: Jre=jvm+java class Library
JDK (Java Development kits), Java Development Toolkit
The JDK is available to Java developers, including JRE and Java development tools such as compilation tools (Javac.exe), packaging Tools (Jar.exe), and so on. So there is no need to install the JRE with the JDK installed. As the Java language Learner, we have to install the JDK, there is no JDK, we are not able to compile and run Java code, this is almost all the Java Introductory Tutorial recommended that we install the JDK reason.
Summary: Jdk=jre+java Development tools
Thank you for reading, I hope to help you, thank you for your support for this site!