Centos installation jdk1.8

Source: Internet
Author: User
Tags centos server

I installed it according to the link on the right, but the first step is different oh. Http://www.cnblogs.com/spiders/archive/2016/09/06/5845727.html

1. Download the RPM installation file.

1.1 via command line: Curl-o http://download.oracle.com/otn-pub/java/jdk/8u111-b14/jdk-8u111-linux-x64.rpm
1.2 Because the first method was unsuccessful, I downloaded the rpm installation file locally and then uploaded it to the CentOS server via xftp (step reference http://www.cnblogs.com/joytree/p/6241137.html). Baidu Network disk: Https://pan.baidu.com/s/1c2CBA6G Extract password: rtt2

2. Installing using the RPM command

RPM-IVH jdk-8u111-linux-x64.rpm

3. Setting Environment variables

Vi/etc/profile

Add the following to the file:

#set Java Environment
java_home=/usr/java/jdk1.8.0_111
Jre_home=/usr/java/jdk1.8.0_111/jre
Class_path=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar: $JRE _home/lib
Path= $PATH: $JAVA _home/bin: $JRE _home/bin
Export Java_home jre_home Class_path PATH

Make a file effective

Source/etc/profile

4. Verification

Java-version

  

Centos installation jdk1.8

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.