Install Java Jdk On Ubuntu Linux Iso

Posted on by  admin
Test to see if Oracle Java was installed correctly on your system. Run the following commands and note the version of Java:A successful installation of 32-bit Oracle Java will display:
  • Type/Copy/Paste: java -version. This command displays the version of java running on your system. You should receive a message which displays: java version '1.7.0_45'
    Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
  • Java HotSpot(TM) Server VM (build 24.45-b08, mixed mode)
  • Type/Copy/Paste: java -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: java 1.7.0_45. A successful installation of Oracle Java 64-bit will display:
  • Type/Copy/Paste: java -version. This command displays the version of java running on your system. You should receive a message which displays: java version '1.7.0_45'
    Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
  • Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
  • Type/Copy/Paste: java -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: java 1.7.0_45

In this guide, you'll learn how to manually install Java 8 on Ubuntu 16.04. The instructions in this tutorial will work on other versions of Ubuntu as well, including 14.04, 16.10, and 17.04.

Prerequisites

  • A text editor, whether it's vi, vim, emacs, etc.

Step 1: Download the latest JDK

It is recommended that you install only the latest JDK.

Step 2: Extract JDK to Java's default location

Create a jvm folder in /usr/lib/ which is the default location for Java.

Go to the created /usr/lib/jvm folder.

Extract the downloaded JDK.

Step 3: Set environment variables

Edit the environment file.

Update the existing PATH variable by adding the below bin folders, separated with a colon :.

HOME directory paths can be different based on version and update,here the version is 1.8 and the update is 151. Add the below variables at the end of environment file, making changes for your specific version and update.

The environment file should now be similar to this text:

Save changes and close the file.

Step 4: Inform Ubuntu about the installed location

Use update-alternatives to inform Ubuntu about the installed java paths.

Step 5: Setup verification

Give the location of java and javac as you provided.

Restart the computer or open a new terminal.

Step 6: Verify the Java version

The output should resemble the following:

You should be able to see your installed java version which means you have successfully installed the Oracle JDK.

Comments are closed.