Linux system installation and configuration JDK

Source: Internet
Author: User

1. Download the JDK

Download the JDK address: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Method One:

Use the command-line download in Linux:

(Note: URL fill in the specific address of the JDK version you need to download)

wget--no-cookies--no-check-certificate--header "COOKIE:GPW_E24=HTTP%3A%2F%2FWWW.ORACLE.COM%2F; Oraclelicense=accept-securebackup-cookie "" Http://download.oracle.com/otn-pub/java/jdk/8u5-b13/jre-8u5-linux-x64.tar.gz "
Method Two:

After the Windows system has downloaded the JDK version, it is uploaded to the Linux system

Rz-eb

  

2. Unzip the JDK

  

3. Configuring Java Environment Variables First step: Modify the/etc/profile file
Vi/etc/profile

Append the following to the end of the file:

#set java environmentjava_home=/usr/jdk1.8.0_20classpath=.: $JAVA _home/lib.tools.jarpath= $JAVA _home/bin:$ Pathexport java_home CLASSPATH PATH
Step Two: Create a new/etc/profile.d/java.sh file (all users have permission to use this environment variable)
vi/etc/profile.d/java.sh

  

#set java environmentjava_home=/usr/jdk1.8.0_20classpath=.: $JAVA _home/lib.tools.jarpath= $JAVA _home/bin:$ Pathexport java_home CLASSPATH PATH

  

Step three: Make the environment variable effective
source/etc/profilesource/etc/profile.d/java.sh
4. See if the Java environment variable is configured successfully
Java-version

See the following to illustrate the success of the environment variable configuration:

[Email protected] profile.d]# java-version
Java Version "1.8.0_20"
Java (TM) SE Runtime Environment (build 1.8.0_20-b26)
Java HotSpot (TM) 64-bit Server VM (build 25.20-b23, Mixed mode)

Linux system installation and configuration JDK

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.