java -version check Java version, no response

I didn't expect that there was a problem with the original Java configuration variables 

For Java program development, jdk commands are mainly used: javac.exe and Java.exe, but these commands do not belong to windows' own commands, so if you want to use it on the dos command window, you need to configure the path

Right-click "This Computer"---->Select Properties---->Select Advanced System Settings---->Click Environment Variables---->Select System Variables (the lower part)

(1) Click New, input variable name: %JAVA_HOME variable value fill in jdk storage path, eg: D:\java\jdk1.8.0_321

(2) Select "Path" and click Edit to create three new variable values: ".", "%JAVA_HOME%\bin", "%JAVA_HOME%\jre\bin"

(3) Select "Classpath", click Edit, and create four new variable values: ".", "%JAVA_HOME%\lib", "%JAVA_HOME%\lib\dt.jar", "%JAVA_HOME%\lib\tools. jar"

ok

Confirm that the environment configuration is correct

Click windows+R and enter cmd to enter the dos command window and enter Java -version to see if there will be a version of jdk. If there is no error, it is ok

 

Guess you like

Origin blog.csdn.net/m0_62055572/article/details/126110770