Today on a new machine, configure the Android environment. System for Win7 flagship 64-bit, downloaded the JAVA8 installation package "Jdk-8u40-windows-x64.exe", installed on the D-disk:
When the installation is complete, right-click on the desktop to open the Command line window, enter "Java-version", "java" command no problem:
Enter the "Javac" command to indicate that "javac is not an internal or external command and is not a running program":
This is not the reason to add the Java installation path in the system variable, the configuration system variable steps are as follows:
First create a new variable in the system variable column, variable name:java_home, variable value:D:\Program files\java\jdk1.8.0_40
Add a system variable, variable name:CLASSPATH, variable value:.; %java_home%\dt.jar;%java_home%\tools.jar (There is a point in front)
Select the variable path to edit, add to the variable value:;%java_home%\bin (if the variable value is empty, do not add a semicolon)
Save the settings, enter "Javac" in the cmd Command Line window, and still prompt the error "Javac is not an internal or external command, nor is it a running program". Many netizens encounter the same problem, there are various statements on the Internet: to install to the C drive, installation path can not have spaces and so on. In fact, these are not problems, I installed on the D drive, and the installation path has spaces.
The above operation is actually no problem, the only thing to do is to close the command window, reopen, enter "Javac", you can see that the correct prompt has occurred:
"Javac is not an internal or external command" issue encountered while installing the configuration Android environment