Download and install the JDK, and configure the Java environment variables

Source: Internet
Author: User
Tags java se

If you want to write a program in the Java language, you have to build a Java development environment, install the JDK, and then configure the environment variables.

One: Download JDK, now the JDK mainstream is Sun's JDK, of course, IBM and some other commercial companies have developed their own JDK, improve programming efficiency, here we take Sun's JDK as an example.

jdk:https://www.oracle.com/downloads/index.html, enter the URL address, the page jumps to the following page, then we select Java SE:

Jump to the following page, then we select the caption shown in the red box:

Next jump to:

There are various versions of the JDK, now the current page is the latest jdk8u66, is the JDK8 upgrade version 66, the latest is not recommended for everyone to use:

1: Bad compatibility with operating system (WINDOWS8,WINDOWS10) or IDE

2: Instability, especially when co-development, low-version development of the program to the new version will be error, it is not recommended.

It is recommended to use the JDK6 version (development), of course, if you can learn to choose freely, so you can continue to choose other versions of the JDK, as follows:

This is the previous version and can be selected by the learner:

The JDK downloads say so much.

II: Install JDK

Once the JDK is downloaded, it will be installed.

1: Double-click the application to start the installation:

As the installation is directed,

You can change the installation directory here, which is no longer installed because the JDK was previously installed on this computer. After you install the JDK, you are prompted to install the JRE application because

The JDK program includes the JRE, so the next application does not need to be installed again.

Three: Configure environment variables

After installing the JDK, configure the environment variables:

1: "Computer" right--property, go to the following page:

2: Click on "Advanced system Settings" to enter the following page:

3: Click on "Environment variables", you can configure Javahome, path, classpath:

4: Meaning of the various variables configured

Java_home: Is the JDK installation path, my installation directory is: F:\Program files\jdk1.6, so even if you need to change the JDK path later, modify Java_home directly, do not have to modify

Path and Classpath.

Path:%java_home%\bin;%java_home%\jre\bin; point to the bin directory, so call Javac compile the source file, or call the JAVA command to run the bytecode file, first in the current directory to find,

If it is not found, it will look in the path.

Classpath:.; %java_home%\lib;%java_home%\lib\tools.jar, pointing to the file path that needs to be run, in fact this classpath can not be configured, in future development will not affect.

Download and install the JDK, and configure the Java environment variables

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.