Home> Java> JavaBase> body text

java is not recognized as an internal or external command solution

Release: 2019-12-16 11:09:33
Original
9954 people have browsed it

java is not recognized as an internal or external command solution

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!