How to upgrade Java?

  1. Wget the rpm package from http://www.java.com/en/download/manual.jsp#lin
  2. Install the package
    [root@vm src]# rpm -Uvh jre-7u7-linux-x64.rpm
    Preparing... ########################################### [100%]
    package jre-1.7.0_07-fcs.x86_64 is already installed
  3. Update alternatives for java
    [root@vm src]# update-alternatives --install /usr/bin/java java /usr/java/jre1.7.0_07/bin/java 3
  4. configure java version using alternatives
    [root@vm src]# alternatives --config java

    There are 3 programs which provide 'java'.

    Selection Command
    -----------------------------------------------
    *+ 1 /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
    2 /usr/lib/jvm/jre-1.4.2-gcj/bin/java
    3 /usr/java/jre1.7.0_07/bin/java

    Enter to keep the current selection[+], or type selection number: 3
  5. Verify the java version
    [root@vm src]# java -version
    java version "1.7.0_07"
    Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
    Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)

Was this answer helpful?

 Print this Article

Also Read

Correct file / folder permissions on Linux

find .-type d -exec chmod 0755{} \; find .-type f -exec chmod 0644{} \;

Powered by WHMCompleteSolution