When I was learning to use the Java command line to compile java files, I encountered this problem
Windows operating system error message
"‘javac’is not recognized as an internal or external command, operable program or batch file"
Reply to the comment area that the environment variable cannot be found And the friend of user variables
Posting blindly
According to the research, there is actually no Installed (or installed but not set in the environment variables)
Step one: Download the corresponding JDK on the website (Just use Just download JDK)
Just click on the place circled in the picture above (If there is a newer version, the operation should be similar )
Install boldly. In fact, this installation is very fast. (When installing, I directly selected the default address (of course the corresponding address is also ok))
The address where my JAVA file is located: C:\Program Files\Java (If you don’t remember, you can reinstall it)
After installation, you need to configure the environment variables. The specific configuration is as follows
In the user variables , add a new variable named java_home and the address is C:\Program Files\Java\jdk-10.0.2. Note that my previous JAVA The address where the file is located.
Add a variable to Path. The respective addresses are C:\Program Files\Java\jdk-10.0.2\bin
Finished After the above operations, it may still not work. There are two solutions here.
The first one, restart itcmd
Path, adjust the location of the two bin folders ( move up to the top), and then restart cmd
You can know from the second method above that, in fact, the javac exe file is in the bin folder (the one of jdk).
The effect after the solutionis as follows
The above is the detailed content of How to solve Java is not an internal or external command, nor is it an operable program issue?. For more information, please follow other related articles on the PHP Chinese website!