javac cannot run after configuring jdk in Win10

Environment variables generally refer to some parameters used in the operating system to specify the operating environment of the operating system, such as the location of the temporary folder and the location of the system folder.
An environment variable is an object with a specific name in the operating system that contains information that will be used by one or more applications. For example, the path environment variable in Windows and DOS operating systems, when the system is required to run a program without telling it the full path where the program is located, the system should not only look for the program in the current directory, but also look for the path specified in path. . Users can run processes better by setting environment variables.
When configuring jdk environment variables in win10, the most common problems we encounter are as follows.        
java can run, java -version is OK, but javac can't run.

      This kind of problem is generally caused by misconfiguration of environment variables in win10

This Computer -> Right Click Properties -> Advanced Properties

      

Reconfigure your own environment variables and it's OK

CLASSPATH variable

.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;

Copy the code above and it's OK

The JAVA_HOME variable selects the path of the local jdk (the upper directory of bin)

Path variable, be sure to write the absolute path name, do not write the relative path name, write the bin directory of the local jdk and the bin directory of the jre in the jdk, this win10 does a good job, you can write it directly, use a different variable instead of one Variables, the embarrassment of adding a semicolon in the middle, adding a semicolon in the middle case, with or without a semicolon can cause the program to fail to run.



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325844125&siteId=291194637