Segments JDK, JVM, JRE, and jdkjvm in the java environment

Source: Internet
Author: User

Segments JDK, JVM, JRE, and jdkjvm in the java environment

Segments JDK, JVM, and JRE in the java environment

Recently, I have taken a small look at Android and have a bunch of concepts including JDK, JVM, JRE, SDK, NDK, and ADT. Here, JDK, JVM, and JRE are the java environment, while sdks, NDK, and ADT are the things used for Android development. Next we will differentiate JDK, JVM, and JRE.

TIPS:After the mac is installed with java, where is it? See

First, let's talk about JDK
JDK (Java Development Kit) is a Java software Development Kit (SDK ).

JDK is the core of JAVA, including the Java Runtime Environment (Java Runtime Envirnment) and a bunch of Java tools (javac/java/jdb) and Java-based class libraries (Java APIs ).

There are three versions:

SE (J2SE), standard edition, standard edition, is a common version. It has been renamed Java SE since JDK 5.0.

EE (J2EE), enterprise edition, and enterprise edition, which are used to develop J2EE applications, have been renamed Java EE since JDK 5.0.

ME (j2e-micro edition) is mainly used for java applications on mobile devices and embedded devices. It has been renamed Java ME since JDK 5.0.

Let's talk about JRE.

JRE is short for Java Runtime Environment. Java Runtime Environment (including Java Plug-in) is Sun's product, which includes Java Runtime Environment and Java Plug-in. JavaRuntimeEnvironment (JRE) is a Java platform on which applications can be run, tested, and transmitted. It includes Java Virtual Machine (jvm), Java core class library, and support files. It does not contain development tools (JDK)-compilers, debuggers, and other tools. JRE needs the auxiliary software -- Java Plug-in -- to run the applet in the browser.
Without JDK, you cannot compile Java programs, but you can run programs on systems in the JRE environment. So when you only need to run a Java program or Applet, download and install JRE. If you want to develop Java software on your own, download JDK.

Let's take a look at the JVM.
JVM is a Java Virtual Machine (Java Virtual Machine). JVM is a specification used for computing devices. It is a fictitious computer, it is achieved by simulating various computer functions on the actual computer.
A very important feature of Java is its independence from the platform. The use of Java virtual machines is the key to achieving this feature. General advanced languages must at least compile different target codes to run on different platforms. After the Java Virtual Machine is introduced, the Java language does not need to be re-compiled when running on different platforms. The Java language uses the Java Virtual Machine to shield information related to specific platforms, so that the Java language compiler only needs to generate the target code (bytecode) that runs on the Java Virtual Machine ), it can be run on multiple platforms without modification. When executing the bytecode, the Java Virtual Machine interprets the bytecode as a machine instruction execution on a specific platform. This is why Java can "compile once and run everywhere.
This is the relationship diagram of the three elements:

The actual situation we developed is: after we developed our own JAVA program using JDK (calling java api), we passed the javac) compile our text java file into JAVA bytecode and run these JAVA bytecode on JRE. The JVM parses these bytecode and maps it to the CPU instruction set or OS system call.

JVM (Java Virtual Machine), that is, Java Virtual Machine

JVM shields information related to the specific operating system platform, so that Java programs only need to generate the target code (bytecode) that runs on the Java Virtual Machine ), it can be run on multiple platforms without modification. When JVM executes bytecode, it actually translates bytecode into machine instruction execution on a specific platform. The Instruction Set for compiling a virtual machine is very similar to the instruction set for compiling a microprocessor.

JVM is the basis for cross-platform Java language (here the "Platform" refers to different operating systems). To run Java programs on different operating systems, you need to install the corresponding JVM on different operating systems. Therefore, the JVM has Windows, MAC, and Linux versions.

JRE (Java Runtime Environment), that is, the Java Runtime Environment

JRE includes the core class libraries required by Java virtual machines and Java programs. To run a developed Java program, you only need to install JRE on the computer.

Conclusion: JRE = JVM + Java class library

JDK (Java Development Kit), that is, Java Development Kit

. Therefore, you do not need to install JRE after installing JDK. As a Java language learner, We must install JDK without JDK. We cannot compile and run Java code. This is why almost all Java tutorials recommend that we install JDK.

Conclusion: JDK = JRE + Java Development Tools

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.