(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