Java Study Notes 1 -- configuration of JDK environment variables in window7, window7jdk

Source: Internet
Author: User

Java Study Notes 1 -- configuration of JDK environment variables in window7, window7jdk

1. First download the Java installation kit

Http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Click Accept License Agreement and download it based on your operating system. The download is complete and installed in the C: \ Program Files (x86) directory.

2. Right-click Windows 7 system and choose "computer"> "Advanced System settings"> "environment variable ".

3. Configure Environment Variables

In "system variables", set three attributes: JAVA_HOME, Path, and ClassPath (Case Insensitive). If the attributes already exist, click "edit". If the attributes do not exist, click "new ".

① JAVA_HOME indicates the JDK installation path, that is, the path selected during installation. Click new. A dialog box is displayed. Enter JAVA_HOME for the variable name and enter C: \ Program Files (x86) for the variable value) \ Java \ jdk1.8.0 _ 40. This path contains lib, bin, jre, and other folders (it is best to set this variable, because tomcat, eclipse, and so on will be run later based on this variable ).

② Path specifies a Path list for searching executable files so that the system can identify java commands in any Path. Because Path already exists in system variables, click Edit, add % JAVA_HOME % \ bin; % JAVA_HOME % \ jre \ bin at the beginning. Remember to add a semicolon (;) at the end (;)

③ ClassPath is the classorlib path of the java load class. Only the class in classpath can be identified by the java command and set :.; % Java_Home % \ bin; % Java_Home % \ lib \ dt. jar; % Java_Home % \ lib \ tools. jar (the beginning must contain. it indicates the current path) In fact, % JAVA_HOME % refers to reference the previously specified JAVA_HOME;

4. test whether the configuration is successful.

Start to Enter cmd, and enter the commands "java-version", "java", and "javac". If a screen is displayed, the environment variable is successfully configured.

If 'javac' is not an internal or external command, or a program or batch file that can be run. This error indicates that the Java environment variable configuration has failed. Check it carefully!

 

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.