How to Upgrade Oracle Java on Ubuntu Linux

Inform your Ubuntu Linux system where your Oracle Java JRE/JDK is located, now you will want to update the system to use Oracle Java 1.7.0_40 Type/Copy/Paste: sudo update-alternatives --install "/usr/bin/java" "java"...

12 Steps 1 min read Medium

Step-by-Step Guide

  1. Step 1: Inform your Ubuntu Linux system where your Oracle Java JRE/JDK is located

    /etc/profile Note your system wide PATH /etc/profile file will reload after reboot of your Ubuntu Linux system , Type/Copy/Paste: java
    -version this command displays the version of Java running on your system ,, Type/Copy/Paste: cd /usr/local/java Type/Copy/Paste: sudo rm
    -rf jdk1.7.0_40 Type/Copy/Paste: sudo rm
    -rf jre1.7.0_40 ,
  2. Step 2: now you will want to update the system to use Oracle Java 1.7.0_40 Type/Copy/Paste: sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/jre1.7.0_40/bin/java" 1 Type/Copy/Paste: sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/local/java/jdk1.7.0_40/bin/javac" 1 Type/Copy/Paste: sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/local/java/jre1.7.0_40/bin/javaws" 1

  3. Step 3: Inform your Ubuntu Linux system

  4. Step 4: that Oracle Java JRE 1.7.0_40 must be the new default Java Type/Copy/Paste: sudo update-alternatives --set java /usr/local/java/jre1.7.0_40/bin/java Type/Copy/Paste: sudo update-alternatives --set javac /usr/local/java/jdk1.7.0_40/bin/javac Type/Copy/Paste: sudo update-alternatives --set javaws /usr/local/java/jre1.7.0_40/bin/javaws

  5. Step 5: Reload your system wide PATH /etc/profile by typing the following command: Type/Copy/Paste: .

  6. Step 6: Test to see if the new version of Oracle Java was installed correctly on your system by running the following commands and noting the version number of the new Java update.

  7. Step 7: You should receive a message which displays: java version "1.7.0_40" Java(TM) SE Runtime Environment (build 1.7.0_40-b08)Java HotSpot(TM) 64-Bit Server VM (build build 25.1-b02

  8. Step 8: mixed mode) Type/Copy/Paste: javac -version this command lets you know that you are now able to compile java programs from the terminal You should receive a message which displays: javac 1.7.0_40

  9. Step 9: Afterwards

  10. Step 10: you have the option of removing the old Oracle Java JDK/JRE

  11. Step 11: by simply removing the directory's which hold the old Java JDK/JRE binaries.

  12. Step 12: Reboot your Ubuntu Linux system and your system will be fully configured for running and developing Java programs.

Detailed Guide

/etc/profile Note your system wide PATH /etc/profile file will reload after reboot of your Ubuntu Linux system , Type/Copy/Paste: java
-version this command displays the version of Java running on your system ,, Type/Copy/Paste: cd /usr/local/java Type/Copy/Paste: sudo rm
-rf jdk1.7.0_40 Type/Copy/Paste: sudo rm
-rf jre1.7.0_40 ,

About the Author

J

Jose Ortiz

Brings years of experience writing about crafts and related subjects.

65 articles
View all articles

Rate This Guide

--
Loading...
5
0
4
0
3
0
2
0
1
0

How helpful was this guide? Click to rate: