Abstract

Introduction

Installing Java on Linux follows the download-extract-configure
pattern. We will begin by downloading Oracle Java from Oracle’s website,
extracting the download in the appropriate folder, and finally
informing Ubuntu about the newly installed version of Java.

Step 1: Verify that you do not already have the correct version of Java installed.

Open your console window and enter the following command:

java –version

If you get the following result, you already have Java 7 update 25 installed and can ignore the rest of the steps:

java version 1.7.0_25

Java(TM) SE Runtime Environment (build 1.7.0_25-b15)

Java HotSpot(TM) Client VM (build 23.25-b01, mixed mode)

Step 2: Download Oracle Java.

New release of Java are featured on the main Java download page.
If Java 7 update 25 is no longer featured, you can find the download by following the Previous Releases link found on the main download page.
Open the Java download page in your browser and download jdk-7u25-linux-i586.bin.
Make a note of the folder to which you downloaded the file. For further
reference in this blog, I will call this folder the “downloads folder”.

Step 3: Create the installation folder.

The usr/lib/jvm is the default installation location of
the Java JDK. Enter the following command in your console to create this
folder, if it does not already exist:

1

sudomkdir-p /usr/lib/jvm

The –p option ensures that all folders in the mkdir path are created.

Step 4: Navigate to the “downloads folder”.

If you downloaded the file to your Home folder, you can use the following command: