Perform the following steps to configure JDK environment variables: 1. my computer --> properties --> advanced --> environment variables. 2. configure user variables:. create java_home c: \ Program Files \ Java \ j2sdk1.5.0 (JDK installation path) B. create PATH % java_home % \ bin; % java_home % \ JRE \ bin c. create classpath .; % java_home % \ Lib; % java_home % \ Lib \ tools. jar 3. test whether the environment variable is configured successfully: start --> Run --> press cmd to enter: The corresponding command appears in javac Java, instead of the error message, indicating that the configuration is successful! Environment variable configuration: 1. PATH environment variable. The function is to specify the command search path. Execute the command below the I command line, such as javac compiling Java ProgramIt will go to the path specified by the PATH variable to check whether the corresponding command program can be found. We need to add the bin directory under the JDK installation directory to the existing PATH variable. The bin directory contains frequently used executable files such as javac/Java/javadoc waiting, after setting the PATH variable, You can execute tools such as javac and Java in any directory. 2. classpath environment variable. The function is to specify the Class search path and use the classes that have already been compiled. The premise is that you can find them, and JVM searches for classes through classpth. We need to set DT. jar and tools. jar in the Lib subdirectory under the JDK installation directory to classpath. Of course, the current directory "." must also be added to this variable. 3. java_home environment variable. It points to the JDK installation directory. Eclipse, netbeans, tomcat, and other software find and use the installed JDK by searching the java_home variable.
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.