Upgrading Oracle Java

Java Platform, Standard Edition (Java SE) lets you develop and deploy Java applications on desktops and servers, as well as in today’s demanding embedded environments. Java offers the rich user interface, performance, versatility, portability, and security that today’s applications require.

(Current Java version 8u92)

In this tutorial I will show you how to upgrade Java to the latest version available.

If you don’t have Oracle Java installed on your system, you can check out our Install Oracle Java tutorial.

This tutorial is for x64 version and it is the same for x86 but make sure you download x86 if you have 32-bit system.

Packages needed for installation:

  • JDK (Java Development Kit)
    • For Java Developers. Includes a complete JRE plus tools for developing, debugging, and monitoring Java applications.
    • Download from Oracle website
  • JRE (Java Runtime Environment)

Upgrading Oracle Java

Note: This tutorial is based on our Oracle Java Installation tutorial and if you didn’t follow that, you’ll have some additional steps.

1. Download and prepare Java files

Go to links listed above and download packages you need.

After you downloaded Java, you need to copy files to the directory of old Java.

Open Terminal, navigate to your download directory and type:

Note: This will copy JDK archive

Note: This will copy JRE archive

2. Unpack Java files

Go to Java location:

Run following commands to unpack archives:

For JDK:

For JRE:

Run this to list folder content:

You should now have new directories

Along with the old ones.

3. Modify system PATH

We need to modify location for the new Java directories.

To do that, run:

or if you prefer GUI:

Add following to the end of the file, overwriting existing Java informations:

Save and exit file.

4. Inform system

You need to inform your system where your new Java files are located.

Type following commands:

Now inform your system that Oracle Java must be default Java:

And finally you need to reload your /etc/profile to apply changes.

To do that, type:

After that, reboot your system.

5. Test your new Java installation

Open Terminal and type this to test your Java version:

You should get this:

Test javac Java Compiler:

You should get this output:

6. Cleaning up after installation

Go to Java directory:

Run following commands to remove downloaded files:

And run this to remove directories of previous Java version:


The latest Java version installation is completed.

Your system should be now configured for developing and running Java applications.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *