Install java and yumjava in yum
We recommend that you use yun to deploy the java environment when deploying the production system.
1. Enable epel Source
# Yum-y install epel-release
2. install java
# Yum-y install java-1.6 *
The epel source is currently installed in version 1.6.
3. Upgrade java
(1) Enable the epel test Source
Edit vi/etc/yum. repos. d/epel-testing.repo
[Epel-testing]
Name = Extra Packages for Enterprise Linux 6-Testing-$ basearch
# Baseurl = http://download.fedoraproject.org/pub/epel/testing/6/?basearch
Using list = https://mirrors.fedoraproject.org/metalink? Testing-epel6 & arch = $ basearch
Failovermethod = priority
Enabled = 1
Gpgcheck = 1
Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
(2) Disable epel Normal Source
# Vi/etc/yum. repos. d/epel. repo
[Epel]
Name = Extra Packages for Enterprise Linux 6-$ basearch
# Baseurl = http://download.fedoraproject.org/pub/epel/6/?basearch
Using list = https://mirrors.fedoraproject.org/metalink? Epel-6 & arch = $ basearch
Failovermethod = priority
Enabled = 0
Gpgcheck = 1
Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
(3). Upgrade java
# Yum-y install java-1.7 *
Note: During yum upgrade, you cannot upgrade java from 1.6 to 1.7.