Download the JDK (http://www.oracle.com/index.html) corresponding to the operating system on the official website
For example, my installation path is E:\jdk1.7.0_51\JDK
Right-click computer----> Properties----> Advanced system settings----> Advanced----> Environment variables
Create a new environment variable in the system variable named Java_home, with a variable value of E:\jdk1.7.0_51\JDK
Add%java_home%\bin at the front of the PATH environment variable;
Enter the Javac command under the DOS console, and if there is a message, the configuration succeeds
Description
1. The PATH environment variable is configured so that the Java development tool (. exe file) under the Bin directory can be run under any path in the DOS console, and an executable file will be looked up in the current path first, and if it does not exist, it will go to the PATH environment variable and look for it in turn.
2. The new java_home is designed to avoid frequent changes to the PATH environment variable.
3.classpath environment variable is not recommended, JDK5.0 after Java will automatically find the core class library, it is a place to store the class file, the method is set as follows:
New CLASSPATH environment variable
(1) variable named D:\: Starting the JVM will look for the. class file under the D drive path, no error is present
(2) The variable name is d:\; : Starting the JVM will first look for the. class file under the D-Drive path, no longer found under the current path
(2) the variable name is; D:\: Starting the JVM will first look for the. class file under the current path, no longer found under the D-drive path
can be interpreted as the current path
Temporary environment variable configuration:
Under DOS console, the command is as follows:
Set: View so environment variable information
Set environment variable name: View specified environment variable information
Set environment variable name =: Empties the specified environment variable information
Set environment variable name = Path: Modifies the specified environment variable information
Set environment variable name = new Path;% original environment variable%: You can add a new environment variable on a specified environment variable
Configuration and description of Java environment variables under Win7