After installing jdk and setting the environment variables, entering the javac command in cmd cannot be used, prompting "javac is not an internal command or an external command, nor is it an operable program or batch file. ” But entering java -version can display the jdk version number normally, indicating that the java command is available. After I entered Java -home, I found that the path pointed to was completely wrong and the environment variable settings did not work. I don't know why.
Solution:
Run——>cmd
Run the following command in the console to set the java environment variable to solve the problem:
set java_home=C:\Program Files\Java\jdk1.6.0_26 The root directory where JDK is installed
set classpath=%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib\dt.jar;
set path=%JAVA_HOME%\bin;
Note: The input is not case sensitive, and several Java commands are attached
java -help You can view the commands
java -home View JDK installation path
java -version View JDK version
For more java knowledge, please pay attention to thejava basic tutorialcolumn.
The above is the detailed content of java is not recognized as an internal or external command solution. For more information, please follow other related articles on the PHP Chinese website!