Java notes-JDK, JRE, and JVM

Source: Internet
Author: User

(1) JDK and JRE

The JDK (Java development Kit) not only contains a superset of the Java Runtime Environment JRE (Java Runtime Environment), but also provides developers with Javac, Java, Javadoc, A compiler such as a jar, and some other development tools.

Java Runtime Environment (JRE) contains the JVM (Java Virtual Machine) that executes the bytecode file, library functions, the files necessary to run JAVA applications, and applets. The Java runtime Environment has features such as load code (class loader), checksum code (bytecode verifier), and execution code (runtime interpreter).

(2) Configuring environment variables

Configure the System environment variable path: When executing a DOS command, the system looks for the execution file of the command in the path specified by path (static + temp). Need to append in front of ".; % java_home%\bin; ". Where: Java_home is the JDK installation directory, semicolon is used to separate multiple directories, directory values cannot be semicolon; The dot number represents the current directory.

Configure the Classpath path: If you use jdk1.5 above you do not need to configure this environment variable! The JRE automatically searches for class files and associated jar files under the current path.

Run the cmd input command "java–version" to indicate that the JDK installation succeeded by indicating that the following results occurred.

(3) JVM virtual machine

The core of a cross-platform implementation of Java is to provide different JVMs for different operating systems. The JVM masks the difference between the underlying platform and provides a unified bytecode for the upper layer (the Byte-code code is a platform-independent machine instruction) execution environment that enables "compile once, run anywhere".

A specification for the JVM (JAVA virtual machine), which is a computer that is emulated by software or hardware on a single computer for virtual execution of bytecode files, similar to a small and efficient CPU. Defines the instruction set, register set, structure stack, garbage collection heap, memory area and so on. IBM, SUN, BEA, Intel, etc. all have different JVM or Java chips for different operating systems (under development), or even can write a JVM according to the JVM specification.

The JVM is responsible for running the Java bytecode Interpreter (interpretation) and running the side interpretation, so that the speed will be affected. Java provides another way to explain how to run the JIT (just in time, instant compilation), that is, the code generator converts the "hot spot" bytecode interpretation into a high-speed local machine code running on a particular platform, and caches the results, next time directly from memory, This greatly improves the efficiency of executing Java code. This enables cross-platform, portable functionality.

Java notes-JDK, JRE, and JVM

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.