Software 151 Tao Tao
First of all, you should have installed the Java JDK, the author installed is: jdk-7u7-windows-x64
Next the main talk about how to configure the environment variables of Java, but also for the next day I forgot to make a backup
1. Go to the "Properties" option of "Computer" and select "Advanced system Settings" as shown in:
2. When you click on "Advanced system Settings", you will see the dialog box as shown, select "Environment variables":
3. After clicking on "Environment variable", you will see the dialog box as shown:
4, the next step is the specific configuration process:
①, select "New" as shown,
"Variable name": Java_home
"Variable value": C:\Program files\java\jdk1.7.0_07
Note: the "Variable Value" column mainly fills in the path where you install Java, which may vary depending on the individual situation
②, after the previous step, select "Path" in the environment variable, as shown in:
Edit after Selection:
At the top of the "Variable Value" column, add the following code:
%java_home%\bin;%java_home%\jre\bin;
Note: The above code is best for one character, because Java_home has limited the path to your JDK, and each version of Java JDK should be made up of these things.
③, after the previous step is determined, then "new":
"Variable name": ClassPath
"Variable value":.; %java_home%\bin;%java_home%\lib\dt.jar;%java_home%\lib\tools.jar
Note: The above code is best also a character unchanged paste up, "variable value" the most front.; Don't miss out.
After completing the three steps above, the configuration of the environment variable has been completed.
5, check the environment variables set up: Call "cmd" check
1. Input: "Java", you should see the following things:
2, enter "Javac", you should see the following things:
3, enter "Java-version", you should see the following things:
If the above three pictures are seen, congratulations, the environment variable configuration is OK!
1. Path environment variable. The function is to specify the command search path, and when executing the command under the shell, it looks in the path specified by the path variable to see if the appropriate command program can be found. We need to add the bin directory in the JDK installation directory to the existing path variable, and the bin directory contains the frequently used executables such as Javac/java/javadoc wait, and after setting the path variable, you can execute the Javac/java tool in any directory.
2. CLASSPATH environment variables. The role is to specify the class search path, to use the already written classes, the premise is to be able to find them, the JVM is through the classpth to find the class. We need to set the Dt.jar and Tools.jar in the Lib subdirectory of the JDK installation directory to classpath, of course, the current directory "." must also be added to the variable.
3. Java_home environment variables. It points to the JDK's installation directory, and software such as Eclipse/netbeans/tomcat finds and uses the installed JDK by searching for java_home variables.
”
Java configuration Environment variables, methods, and reasons