Setting JDK environment variables in Windows

Source: Internet
Author: User

Assume that the JDK installation path is "D:/Java/jdk1.6.0 _ 13 ".

In Windows 2000/XP, set the JDK environment variable:

My computer> System Properties> advanced> environment variables> System Variables

① Java_home = D:/Java/jdk1.6.0 _ 13

② Path = % java_home %/bin; % java_home %/JRE/bin

③ Classpath =.; % java_home %/LIB; % java_home %/lib/tools. jar; % java_home %/lib/dt. Jar

P.s .:

① The variable names and variable values of Windows environment variables are case-insensitive. for example, path indicates the same variable name. In addition, if a variable name already exists, the variable with the same name will overwrite the variable value of the original variable,Be careful!

② Set the java_home variable to facilitate reference. for example, if the JDK installation directory is "D:/Java/jdk1.6.0 _ 13", set java_home to this path. To use this path later, you only need to enter % java_home %, avoid entering a long path string for each reference. The second is the normalization principle. when the JDK path is changed, you only need to change the variable value of java_home. Otherwise, you need to change the absolute path to reference the JDK directory document. In case of incomplete modification, a program cannot find JDK, may cause system crash;

③ Set the PATH variable to run Java applications, such as javac, Java, and javah, in any path in the system;

④ Set the classpath variable to let the Java interpreter know where to find the class when you need to reference existing classes during Java program development. note that there is ". ", indicating the current directory. in this way, when running Java Aclass, the system will first find the Aclass file in the current directory.

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.