[Java Learning notes] Installation of JDK and configuration of environment variables

Source: Internet
Author: User

1.JDK Download and Installation

The JDK (Java Development Kit) is a set of Java development tools that Java provides to us, which must run on the JVM (Java Virtual Machine), and the Java language's cross-platform is implemented with Java running on different platform versions of the JVM. For example, the JVM has Linux version, Windows version and Mac version, our written Java program can run on these three different operating systems without modification, that is, relying on these platforms corresponding JVM.

    • download of JDK

Java is currently the latest version is jdk-8u60, click on this link to download java8.0, the above and below is the difference between the following is the use of the API small sample.

    • installation of the JDK

The installation of the JDK is simple and the next step is to install the idiot. It is important to note that you do not need to choose the installation of the JRE, and remember to install your own directory (set environment variables to use).

The JRE is the environment in which the Java program runs, contains the JVM and some basic tools, and the JDK contains the JRE and some Java APIs. All when installing the JDK, you do not have to choose to install the JRE.

2. Configure Environment variables

Purpose: To make all programs in the Java Bin directory executable anywhere, configure Java_home environment variables to be used by other programs, such as Tomcat.

Right-click My Computer, advanced system settings, environment variables, create a new system variable named Java_home, and the variable value is the Java installation directory. Such as:

Next, edit the PATH environment variable in the system variable and add%java_home%\bin to the front (note that the semicolon is not missing).

-Temporary environment variable configuration (scoped to the current command line window):

Use the SET command to view, modify, delete, append environment variables

View: Set Path

Modified: Set Path=xxx

Delete: Set path=

Append: Set path=xxx;%path%

CLASSPATH environment variable: Use set classpath=xxx or set classpath=xxx; or set classpath=.; XXX New and set CLASSPATH environment variables.

The last semicolon, means to find the class file to be executed under the Classpath path, no, then look in the current directory; Where the decimal point represents the current directory.

Purpose: When introducing a third-party jar package, it is generally necessary to set the CLASSPATH environment variable, otherwise the class to be used cannot be found.

[Java Learning notes] Installation of JDK and configuration of 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.