How to configure Java environment variables? Java environment variable setting tutorial

Source: Internet
Author: User

How to configure Java environment variables? Java environment variable setting tutorial

How to Set Java environment variables? The Java language has the cross-platform feature. The compiled program can run on multiple operating system platforms and can implement the powerful function of "writing once and running everywhere. However, Java needs to manually configure environment variables, which is a great challenge for beginners of Java. Next, let's teach you how to set Java environment variables.

Tools required for setting Java environment variables:

JDK 1.7 installation package

Steps for setting Java environment variables:

To successfully configure the Java environment variables, you must install JDK to start configuration.

1. Install the JDK Wizard to set relevant parameters.

4. Select the installation path, which can be customized or default.

5. The installation is successful.

After the installation is successful, test whether the installation is successful. Click "start" ---- "run" ---- enter "CMD", enter "Java-version" in the command prompt box, and press the Enter key, the installation is successful.

6. Start to configure the environment variables and right-click "my computer" ---- "properties" ---- "advanced" ---- "environment variables ",

2. Select the optional features to be installed. For example:

3. Installing Program functions.

7. select "New System variable" ---- the "New System variable" dialog box is displayed. In the "variable name" text box, enter "JAVA_HOME "; in the variable value text box, enter the JDK installation path (that is, the folder path in step 5) and click OK.

8. in the "System variables" option area, check the PATH variable. If it does not exist, create a new variable PATH. Otherwise, select the variable and click "edit, add "% JAVA_HOME % \ bin; % JAVA_HOME % \ jre \ bin;" or directly "% JAVA_HOME % \ bin;" to the start position of the variable value text box ;", click OK.

9. check the CLASSPATH variable in the "System variables" option area. If the CLASSPATH variable does not exist, create the CLASSPATH variable. Otherwise, select the variable and click "edit, add "." To the start position of the variable value text box. % JAVA_HOME % \ lib \ dt. jar; % JAVA_HOME % \ lib \ tools. jar ;".

10. Check whether the environment variable configuration is successful. Enter "JAVAC" in the doscommand line window, and the output help information is correctly configured.

Note: Remember not to miss the last ";" symbol when editing the "variable value.

Related Article

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.