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.