centos6.x Uninstall OPENJDK and install the configuration Sun JDK1.8

Source: Internet
Author: User

CentOS installation configuration Jdk method is more, recommended to install with tar.gz package, install file directory itself controllable.


Environmental centos6.3


1. Download the JDK:


Http://download.oracle.com/otn-pub/java/jdk/8u65-b17/jdk-8u65-linux-i586.tar.gz


2. Check uninstall the default JDK that is already installed

[Email protected] etc]# Rpm-qa | grep JDK

java-1.6.0-openjdk-1.6.0.0-1.45.1.11.1.el6.i68

[Email protected] etc]# yum-y Remove java-1.6.0-openjdk-1.6.0.0-1.45.1.11.1.el6.i686


3. Install the JDK into the/usr/java/jdk.xxx directory

Create Directory Mkdir/usr/java

Upload jdk-8u65-linux-i586.tar.gz to/usr/java

Perform decompression tar–zxvf jdk-8u65-linux-i586.tar.gz under/usr/java, and view after decompression


[email protected] java]# LL

Total dosage 179036

Drwxr-xr-x 8 UUCP 143 4096 October 7 06:54 jdk1.8.0_65

-rw-r--r--1 root root 183326697 January 8 16:16 jdk-8u65-linux-i586.tar.gz


4, the configuration environment variables, this is a reliable approach, the internet is all said to change the profile file, in fact, the CentOS profile inside the note file has been written, not recommended to modify this file, but in PROFILE.D below the new user's own configuration file. This will take effect as well.


[Email protected] profile.d]# pwd

/etc/profile.d

[Email protected] profile.d]# touch jdk.sh

[Email protected] profile.d]# VI jdk.sh


Add the following to the jdk.sh file:

Export java_home=/usr/java/jdk1.8.0_65

Export path= $JAVA _home/bin: $PATH

Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar


After saving, then execute the following command:


[Email protected] profile.d]# source/etc/profile

[Email protected] profile.d]# java-version

Java Version "1.8.0_65"

Java (TM) SE Runtime Environment (build 1.8.0_65-b17)

Java HotSpot (TM) Server VM (build 25.65-b01, Mixed mode)


OK, the configuration is successful!



If it is the RPM package format, then the installation is a command, here you can see:

http://my.oschina.net/cennac/blog/215573

This article is from the lava blog, so be sure to keep this source http://lavasoft.blog.51cto.com/62575/1733003

centos6.x Uninstall OPENJDK and install the configuration Sun JDK1.8

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.