Java's jdk configuration is successful, but input java -version, etc., the command line does not respond

Question: Now many students have this situation,

Java's jdk configuration is successful, but input java -version, etc., the command line does not respond

After downloading Java, manually configure the environment variables, and the configuration is complete, but no matter what java is entered in the command line, there is no response. Problem
: The environment variables of the JDK1.8 version are manually configured, but the command line window java、javac、java -versionis input. no response

Solution:

first step:

Open cmd (command line window), enter where java in the command line, you can view the Java environment configuration in the environment variable, as shown in Figure 1:

figure 1

insert image description here

The first two lines of environment variables are the environment variables automatically generated by the software when I installed the jdk15 version, but when I enter the command lines java, javac, java -version, nothing happens, as shown in Figure 2:

figure 2

insert image description here

The last two lines of environment configuration are environment variables that I downloaded a JDK1.8 version and manually configured by myself.

Find the reason through various aspects, and the final reason is locked in the order of configuring environment variables

Step 2:
Open and edit system environment variables, you can search in the search box, as shown in Figure 3

image 3

insert image description here

After opening, click the environment variable, and then the environment variable window will pop up, as shown in Figure 4

Figure 4

insert image description here

Find the Path of the system variable and click Edit, as shown in Figure 5:

Figure 5

insert image description here

Step 3
Move your two manually configured environment variables to the front of the two environment variables automatically configured by the software, as shown in Figure 6:

Figure 6

insert image description here

Just keep clicking OK

Re-open the command line window, enter where Java, then you can see that the order has changed, as shown in Figure 7

Figure 7

insert image description here
At this time, enter java -version again, and you can see the corresponding jdk version number, as shown in Figure 8:

Figure 8

insert image description here

Finally: problem solved

Guess you like

Origin blog.csdn.net/weixin_58276266/article/details/131699409