Refers to the Java Development Kit, which is a software development kit required for the development of Java applications.The JDK includes necessary components such as the Java compiler, Java virtual machine, Java class libraries, and other tools for developing, debugging, and running Java applications.
Using the JDK helps developers write, test, and deploy Java applications, as well as the Java Runtime Environment (JRE) needed to run Java applications.The JDK is provided by Oracle and can be downloaded and used free of charge on its official website.
The runtime environment (JRE) is the software required for a Java program to run correctly. Java is a computer language that supports many of today's Web and mobile applications.The JRE is the underlying technology that communicates between Java programs and the operating system. It acts as a translator and coordinator, providing all the resources so that you can write Java software that runs on any operating system without further modification.
It is a part of JRE. It is a fictitious computer, which is realized by simulating various computer functions on an actual computer.JVM has its own perfect hardware architecture, such as processor, stack, registers, etc., and also has the corresponding instruction system.The most important feature of the Java language is cross-platform operation. The use of JVM is to support independent of the operating system to achieve cross-platform. Therefore, the JAVA virtual machine JVM belongs to the JRE, and now we install the JDK also comes with the installation of the JRE (of course, you can also install a separate JRE).
1. Open the browser and enter the URL/, enterOracle Official Website
2. In the official home page menu bar, click Products, find Java in Software, click the option
3. In the interface down, you can see the following options, in the option to select Java SE, find Oracle JDK, click to enter the JDK download interface
4. In the interface you can find a variety of versions of the JDK, choose the version you need to download. Here I choose JDK1.8 X64 version to download and install!
5. After downloading the JDK to the local, find the file, double-click to run the JDK installation program
6. If you want to verify whether the installation is successful, you can press Win+R, enter cmd to enter the command prompt (you can refer to the previous view of the computer's configuration information operation), in the command prompt interface, type java
7. Right-click on this computer and click on Properties, the following settings options will appear, click on Advanced System Settings and turn on Win10
8. Click Environment Variables
9. Click New, variable name JAVA_HOME, variable value for just JDK installation path, click OK!
10. Type `%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin; at the beginning of the variable value.
11. Click OK, after all the OK exit, still press Win+R, type cmd to enter the command prompt interface, type javac, if the following interface appears, the configuration is successful.
1. Open cmd and enter the folder where the source file is located
Method 1: Press Win+R shortcut key, type cmd, and then enter the folder where the source code is located (my source code directory is D:\Java, enter the folder and type "cd folder name", and exit the current folder and type "cd\").
Method 2: Type cmd in the source code directory and press Enter.
2. Compilation
enter "javac source file name.java" command, press Enter, open the Java compiler and compile, after the end of compilation, will automatically generate a source file name.class byte code file.
If you get "Error: Unmappable character (0x8D) encoding GBK", you need to add -encoding UTF-8 after "javac".
3. Running
Input "java source file name" command, press Enter, start the Java virtual machine to run the program. Java virtual machine will first be compiled byte code files loaded into memory, this process is called class loading, it is completed by the class loader, and then the virtual machine for the Java classes loaded into memory to interpret the execution, you can see the results. Interpretation of the Java class loaded into memory, you can see the results.