How to Set JDK Environment Variables

Source: Internet
Author: User

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.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.