1. Install JDK. You can customize the installation directory and other information during the installation process. For example, select c: \ Program Files \ Java \ jdk1.7.0 _ 01 as the installation directory;
2. After the installation is complete, right-click "my computer" and click "properties ";
3. Select the "advanced" tab and click "environment variables ";
4. In "system variables", set three attributes: java_home, path, and classpath (case-insensitive). if it already exists, click "edit". If it does not exist, click "new ";
5. java_home indicates the JDK installation path, which is the path c: \ Program Files \ Java \ jdk1.7.0 _ 01 selected during installation. This path includes Lib, bin, JRE and other folders (it is best to set this variable, because later running tomcat, Eclipse, etc. all need to follow * this variable );
Path allows the system to recognize Java commands in any path. It is set:
% Java_home % \ bin; % java_home % \ JRE \ bin
Classpath is the classorlib path of the Java load class. Only the class in classpath can be identified by the Java command and set:
.; % Java_home % \ Lib \ DT. jar; % java_home % \ Lib \ tools. Jar (Add. to indicate the current path)
% Java_home % refers to the previously specified java_home;
6. "Start"->; "run", type "cmd ";
7. type the following commands: "Java-version", "Java", and "javac". If a screen is displayed, the environment variable is successfully configured;
Problems encountered during self-configuration: Entering the javac command to display javac is not a command error, while entering Java will display relevant information normally. Tested ProblemsYou only need to put the environment variables set in the path at the beginningThe problem is solved.
I am a Windows 7 system and JDK is jdk1.7.0 _ 01;