The most comprehensive JDK installation tutorial: JDK download and install tutorial + CMD Java entry is effective but Javac entry is invalid Solution

java , jdk (Java Development Kit Java) , java jdk : ([ : :]
1. JDK download address:

You should see the interface shown in the figure below:

2. Click on the place mentioned by the arrows in the above figure, and the following interface will appear. Currently, you need to select the appropriate version according to your computer system. Pre-select version and download as follows:

3. To install the JDK twice later (remember to change the installation path according to the second picture, and don’t install everything on the system drive…):
(1) Double-click the installation interface, as shown below:

4. After the installation is completed, you need to set the environment variable. Right click on My Computer Theme – Advanced System Settings you will see the interface as follows:

5. Click on the environment variable in the above image, and then run the environment variable configuration:
(1) Click the new button under the system variable, variable name java_home (representing the JDK installation path), the value corresponds to the JDK installation path.

(2) Continue to create a new Path class variable in the system variable, and its variable value is shown in the figure below:

Note here: There is a small dot in front. Entity Entity Entity Many beginners fall into this hole with their own set of environment variables.
(3) Find the path variable in your system variables. You need to add additional code to your value field:



Currently, you have to add it behind your original value range. Don’t forget to add the English language account behind the original domain.
Finally, click OK, the JDK environment variable configuration is now complete.
6. Check if the environment variable you are setting is correct,
(1) Windows + R, type CMD and enter the command line interface as shown below:

(2) Enter the command java -version. It may appear as shown below. You can see which JDK version you have installed.

(3) Enter a Javac command to display the following prompts:

(4) Enter the Java command to appear as shown in the figure below

7. Write a piece of code to test it
(1) I have created a folder called Javafile on drive E. It contains a Java file called For now you have to pay attention.
(2) You need to write the following code in your file:

public class TestJava{
public static void main(String[] args){
	System.out.println("I am a  java new learner!");

(3) Hold Windows key + R to the DOS prompt. You need to first enter the directory where the java file is located, then compile the java file with the javac command, and then use the java command to parse the results. The command will be Javac Compile. As shown in the figure below:

Note here that you must enter the directory where the file is located. Secondly, you must follow the suffix name of the javac command file after the javac command file name.
When a javac command is executed without an error prompt, it will be compiled and a .class file with the same name will be generated in the file directory.

If you have completed all of the above and the results show it correctly, then your JDK installation and environment configuration is very successful. At this time, you can start learning Java.
JDK1.8 API link:
Java tutorials:

The laptop system is Win10 64-bit system. JDK and JRE are installed according to the online manual

Running CMD will output a java entry, but a javac entry is not a javac error in an internal or external command.

final solution:

Type in CMD: SET PATH=”%java_home%\bin”


Leave a Comment