How to Set JDK Environment Variables
Right-click my computer. Open properties. Then select "environment variables" in "advanced". You need to set the variables in the system variables in the new open interface.
The three attributes are "java_home", "path", and "classpath". In the environment where JDK is not installed, the path attribute originally exists. While
Java_home and classpath do not exist.
First, click "new" and write java_home in the variable name. The variable is the installation path of Java,
Then, write the installation path "E: \ Java \ jdk1.6.0 _ 02" in the variable value ";
Find the path in the system variable and click Edit. The meaning of the PATH variable is that the system can recognize Java commands in any path. The variable value is
"% Java_home % \ bin; % java_home % \ JRE \ bin" (where "% java_home %" means the value of java_home just set), you can also directly write
On "E: \ Java \ jdk1.6.0 _ 02 ";
Click "new", and then write classpath on the variable name. The variable indicates the path of the Java loading class (class or Lib), only the class
In classpath, Java commands can be recognized. The value is ".; % java_home % \ Lib \ tools. Jar (Add. to indicate the current path )",
Similar to "% java_home %"
After the preceding three variables are set, press "OK" until the attribute window disappears. verify whether the installation is successful. Start "start"-> "run ",
Go to cmd to enter the DOS system interface. Then, press "Java-version". If the installation is successful. The system displays the Java version information.
In addition, when installing Java, JDK and JRE must have two directories. If you select the same directory during installation, the "bin" and "lib" files will overwrite.
The Lib \ tools. jar file does not exist. Even if the environment variable is set correctly, javac is unavailable !! Therefore, after installing JDK, you must check that
Whether the tools. jar file exists. If yes, set the environment variable as described above.