Home >Java >javaTutorial >What should I do if I cannot view java_version?
The solution to the problem that java_version cannot be viewed: First click [My Computer-Properties-Advanced-Environment Variables]; then query "JAVA_HOME" in "New System Variables"; then in the "System Variables" option Check the PATH variable and CLASSPATH variable; finally enter "JAVAC".
Solution to the problem that java_version cannot be viewed:
1. Right-click [My Computer] ---[ Properties]-----[Advanced]---[Environment Variables].
2. Select [New System Variable]--the "New System Variable" dialog box will pop up, enter "JAVA_HOME" in the "Variable Name" text box, and enter "JAVA_HOME" in the "Variable Value" "Enter the JDK installation path in the text box (that is, the folder path in step 5), and click the "OK" button.
3. Check the PATH variable in the "System Variables" option area. If it does not exist, create a new variable PATH. Otherwise, select the variable and click the "Edit" button.
Add "%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;" or directly "%JAVA_HOME%\bin;" at the beginning of the "Variable Value" text box, and click the OK button .
4. Check the CLASSPATH variable in the "System Variables" option area. If it does not exist, create a new variable CLASSPATH. Otherwise, select the variable and click the "Edit" button.
Add ".;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;" at the beginning of the "Variable Value" text box.
#5. Now test whether the environment variable configuration is successful or not. Enter "JAVAC" in the DOS command line window. If the help information is output, the configuration is correct. As shown in the picture:
Related learning recommendations: Java video tutorial
The above is the detailed content of What should I do if I cannot view java_version?. For more information, please follow other related articles on the PHP Chinese website!