System Environment: centos-6.5
Installation Method: RPM Installation
Software: jdk-8u20-linux-x64.rpm
: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Verify the current version:
[Email protected] ~]# java-version
List all Java-related software information:
[Email protected] ~]# Rpm-qa | grep java
Uninstall OPENJDK:
[[email protected] ~]# rpm-e--nodeps xxx (xxx for Java related software previously discovered)
To install the JDK:
[Email protected] jdk]# RPM-IVH jdk-8u20-linux-x64.rpm
verify installation to see if the information is normal:
[[email protected] bin]# java
[[email Protected] bin]# javac
[[email protected] bin]# 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)
append the following to the file:
java_home=/usr/java/jdk1.8.0_20
jre_home=/usr/java/ Jdk1.8.0_20/jre
classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib /tools.jar: $JRE _home/lib
export java_home jre_home PATH CLASSPATH
Make the changes effective
[[email protected] ~]# source/etc/profile//Make changes effective immediately
[[email protected] ~]# echo $PATH//view PATH value
Linux installation Java JDK (System: CentOS 6.5 jdk:jdk8.0)