Java sets the meaning of environment variables (JAVA_HOME, PATH, CLASSPATH), java_homeclasspath

Source: Internet
Author: User

Java sets the meaning of environment variables (JAVA_HOME, PATH, CLASSPATH), java_homeclasspath

Before developing a Java program, you must install and configure the Java Development Environment on the computer. One is to directly install Myeclipse and compile and run it using its own JDK; the other is to install JDK on our Windows or Linux platform and configure environment variables. (As the JDK version is updated, the default JDK of Myeclipse remains unchanged unless the latest version of Myeclipse is upgraded.) to install JDK on the operating system platform, the most troublesome thing is to configure environment variables:

 

1. JAVA_HOME(Windows is case insensitive and Linux is case sensitive) JDK installation path.

C: \ Program Files \ Java \ jdk1.8.0 _ 91 JAVA_HOME is installed by default in the blog, the purpose is to facilitate the configuration of JAVA_HOME in the PATH and CLASSPATH paths. The purpose is to facilitate the configuration of PATH and CLASSPATH paths.

2. PATHSince JDK is installed on the computer, the JDK installation path also contains the java and javac commands, but the computer does not know where to find the two commands. If you can find this command, the command can be modified. C: \ Program Files \ Java \ jdk1.8.0 _ 91 \ bin. Of course, if you set JAVA_HOME, you can also % JAVA_HOME % \ bin; when the JAVA_HOME value changes, you do not need to modify the PATH.

3. CLASSPATHAfter configuring the PATH, you can compile the Java class normally and generate a class file in the current PATH. When using java commands to execute classes, where should JRE search for Java classes? Therefore, CLASSPATH is used to create a JRE path to search for Java classes. In versions earlier than JDK1.4, you must add (.) to the CLASSPATH environment variable (.) set the current path, and JRE later than JDK will automatically search for class files in the current path, and the system will automatically load dt. jar and tools. therefore, you do not need to set the CLASSPATH environment variable.

All in all, in environment variables after JDK, we only need to configure PATH. That is, let the computer find the java command.

15:00:00

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.