How to upgrade Java in Red Hat Linux
$ java -fullversion
java full version "1.6.0-b09"
     
$ which java
/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/bin/java
$ whereis java
java: /usr/bin/java /etc/java /usr/lib/java /usr/share/java /usr/share/man/man1/java.1.gz
# file /usr/bin/java
/usr/bin/java: symbolic link to `/etc/alternatives/java'
# ls -l /etc/alternatives/java
lrwxrwxrwx 1 root root 39 Jun 15  2013 /etc/alternatives/java -> /usr/lib/jvm/jre-1.6.0-openjdk/bin/java
# cd /usr/lib
# ls -l
java/                                   java-1.3.1/                              java-1.4.0/
java-1.4.1/                            java-1.4.2/                             java-1.5.0/                              java-1.6.0/
java-ext/                              jvm/                                    jvm-commmon/                             jvm-exports/
jvm-private/
# pwd
/usr/lib/jvm
# ls -la
total 176
drwxr-xr-x   4 root root  4096 Jun 15  2013 .
drwxr-xr-x 154 root root 90112 Jun 19  2013 ..
lrwxrwxrwx   1 root root    26 Jun 15  2013 java -> /etc/alternatives/java_sdk
lrwxrwxrwx   1 root root    32 Jun 15  2013 java-1.4.2 -> /etc/alternatives/java_sdk_1.4.2
lrwxrwxrwx   1 root root    22 Jun 15  2013 java-1.4.2-gcj -> java-1.4.2-gcj-1.4.2.0
drwxr-xr-x   6 root root  4096 Jun 15  2013 java-1.4.2-gcj-1.4.2.0
lrwxrwxrwx   1 root root    32 Jun 15  2013 java-1.6.0 -> /etc/alternatives/java_sdk_1.6.0
lrwxrwxrwx   1 root root    26 Jun 15  2013 java-1.6.0-openjdk -> java-1.6.0-openjdk-1.6.0.0
drwxr-xr-x   6 root root  4096 Jun 15  2013 java-1.6.0-openjdk-1.6.0.0
lrwxrwxrwx   1 root root    30 Jun 15  2013 java-gcj -> /etc/alternatives/java_sdk_gcj
lrwxrwxrwx   1 root root    34 Jun 15  2013 java-openjdk -> /etc/alternatives/java_sdk_openjdk
lrwxrwxrwx   1 root root    21 Jun 15  2013 jre -> /etc/alternatives/jre
lrwxrwxrwx   1 root root    27 Jun 15  2013 jre-1.4.2 -> /etc/alternatives/jre_1.4.2
lrwxrwxrwx   1 root root    26 Jun 15  2013 jre-1.4.2-gcj -> java-1.4.2-gcj-1.4.2.0/jre
lrwxrwxrwx   1 root root    27 Jun 15  2013 jre-1.6.0 -> /etc/alternatives/jre_1.6.0
lrwxrwxrwx   1 root root    30 Jun 15  2013 jre-1.6.0-openjdk -> java-1.6.0-openjdk-1.6.0.0/jre
lrwxrwxrwx   1 root root    25 Jun 15  2013 jre-gcj -> /etc/alternatives/jre_gcj
lrwxrwxrwx   1 root root    29 Jun 15  2013 jre-openjdk -> /etc/alternatives/jre_openjdk

Download Java 1.8 from Oracle

Install the JDK 1.8 rpm
# ls -l *.rpm
-rw-r--r-- 1 oracle oinstall 162181711 Dec  8 18:25 jdk-8u66-linux-i586.rpm
# rpm -ivh jdk-8u66-linux-i586.rpm
Preparing...                ########################################### [100%]
        installing package jdk1.8.0_66-1.8.0_66-fcs.i586 needs 195MB on the /usr filesystem
Comments