How To Install Oracle Java 8 in Ubuntu 16.04
Oracle’s Java eight could be a artificial language that makes several of the applications and websites in use these days. Its present and stable nature makes it a favorite amongst Google and golem developers for the last twenty years. If you have got a Liquid internet Core Managed Ubuntu sixteen.04 LTS server, contact our support team for facilitate with installation. Otherwise, this tutorial guides you thru the way to install Java eight(Java Development Kit) and set the trail of the JAVA_HOME variable.
Pre-Flight Check
- Open the terminal and log in as root. If you are logged in as another user, you will need to add sudo before each command.
- Working on a Linux Ubuntu 16.04 server
- No installations of previous Java versions
Install Oracle Java 8
Step 1: Update & Upgrade
It is advised to update your system by copy and pasting the command below. Be sure to accept the update by typing Y when asked to continue:
Step 2: Install the Repository
WebUpd8 Team Personal Package Archive (PPA), a third-party repository, allows us to download the package necessary for Java 8 installation. Press Enter to continue the installation.
Once again, update your package list.
Step 3: Install Java 8
Use the apt-get command to install Oracle’s Java 8 via their installer:
Click Y to continue and press Enter to agree to the licensing agreement.
Select Yes and hit the Enter key.
Step 4: Verify Java 8 is Installed
Output:
Set Java’s Home Environment
It’s essential to know the path of our Java installation for our applications to function. Where is Java installed? Run this command to find its path:
Output:
Copy the highlighted path from the second row: /usr/lib/jvm/java-8-oracle/jre/bin/java/. After copying, open the file /etc/environment and add in the path of your Java installation to the end of your file.
Save the file by hitting ESC button and type :wq to execute the command below to recognize the changes to the file:
You should now see the path of installation when using the $Java_Home variable:
Add Comment