JAVA configuration environment variables, java environment variables

Source: Internet
Author: User

JAVA configuration environment variables, java environment variables

After JDK is installed, if you want to run a java program directly in Windows, you must configure the java environment variable. Here we use win10 as an example:

Right-click "my computer" --> "properties" --> "Advanced System settings" --> "environment variables", as shown in the following figure: user environment variables and system environment variables, the user environment variables are valid only for the currently logged-on users, and the system environment variables are valid for all users. Therefore, select to configure system environment variables. In "system variables", set three attributes: JAVA_HOME, PATH, and CLASSPATH (Case Insensitive). if it already exists, click "edit". If it does not exist, click "new ". The variable setting parameters are as follows:

1. variable name: JAVA_HOME variable value: indicates the actual installation path of JDK, which should be selected based on your own situation.

2. variable name: CLASSPATH variable value:.; % JAVA_HOME % \ lib \ dt. jar; % JAVA_HOME % \ lib \ tools. jar;(Remember that there is a ".", where JAVA_HOME can be directly written as the actual Path) 3. variable name: Path variable value:% JAVA_HOME % \ bin; % JAVA_HOME % \ jre \ bin;

 

In the process of configuring environment variables, if there are three mentioned above, you can directly add them later. Never delete the original environment variables.

 

Test whether the configuration is successful:

Open cmd and enter java-version. If any, the configuration is successful!

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.