Atlantic.Net Blog

How to Install Java (JRE or JDK) on Ubuntu 14.04

Jose Velazquez
by Atlantic.Net (71posts) under HIPAA Compliant Cloud Storage
Java Illustration by Walker Cahall

Java Illustration by Walker Cahall

Verified and Tested 07/30/15


If you had the option to choose between a base model car or a fully loaded model, which one would you choose?

Both cars will take you from point A to point B, but with the fully loaded car you have additional features that can make rush hour a chill hour.

Well, that’s the same concept when we take a closer look at Java. There are two standard types of installations, JRE (Java Runtime Environment) and JDK (Java Development Kit). Like the base model car, JRE enables the ability to create Java Applications for different types of deployments using minimal core tools to accomplish the task. JDK is a fully loaded Development Kit that has everything that JRE has plus additional resources to create/secure Applications and Applets.


You need an Ubuntu server that is configured with a static IP address.

Installing Java on Ubuntu 14.04

Before we begin, let make sure that the server is fully updated with the following command:

sudo apt-get update

After your server has been fully updated, you will need to know what version of Java is currently installed or if it is not installed, with the following command:

java -version

Once you have verified if Java is installed or not, choose the type of Java installation that you want with one the following:

sudo apt-get install default-jdk
sudo apt-get install default-jre

Install Java Open JRE or JDK on Ubuntu 14.04

One alternative Java install is with Open JRE 7 and JDK 7 and can be installed with one of the following:

sudo apt-get install openjdk-7-jre
sudo apt-get install openjdk-7-jdk

Install Java Oracle JRE or JDK on Ubuntu 14.04

Another alternative Java install is with Oracle JRE and JDK. However, we would need to install additional repositories for a proper installation.

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java

Then, you will need to fully update the system with the following command:

sudo apt-get update

You can also install previous and newer versions of Java by using one of the following commands:

sudo apt-get install oracle-java6-installer
sudo apt-get install oracle-java7-installer
sudo apt-get install oracle-java8-installer

If you have multiple versions of Java installed on your server, then you have the ability to select a default version. Check your alternatives with the following command:

sudo update-alternatives --config java
This is the output after running the Java Alternative script on Ubuntu 14.04

This is the output after running the Java Alternative script on Ubuntu 14.04

Once you have viewed your alternatives, choose the version that you want by selecting the assigned number, and then hit enter.

Setup JAVA_HOME on Ubuntu 14.04

Since many programs now days need a JAVA_HOME environment variable to work properly. We will need to find the appropriate path to make these changes. With the following command, you can view your installs and their path:

sudo update-alternatives --config java

A directory path listing for each installation is below:


To edit the environment file use your text editor and edit the following file:

sudo nano /etc/environment

Now that you are in the environment file, add the following code along with the Path of your installation from the previous step. ( Example: JAVA_HOME=”YOUR_PATH”)


Reload the file so all your changes could take effect with the following command:

source /etc/environment

Verify that your implementations are correct with the following command. Confirm :


What Next?

Congratulations! You now have a successfully installed Java on your Ubuntu server. Thank you for following along and feel free to check back with us for further updates or check out other helpful Ubuntu How-to’s in our blog.


Cloud hosting is just one of the many hosting services offered by Atlantic.Net – we also offer HIPAA compliant cloud storage hosting services. Contact us today for more information!

Start Your HIPAA Project with a Free Fully Audited HIPAA Platform Trial!

HIPAA Compliant Compute & Storage, Encrypted VPN, Security Firewall, BAA, Offsite Backups, Disaster Recovery, & More!

Start My Free Trial

Looking for HIPAA Compliant Hosting?

We Can Help with a Free Assessment.

  • IT Architecture Design, Security, & Guidance.
  • Flexible Private, Public, & Hybrid Hosting.
  • 24x7x365 Security, Support, & Monitoring.
Contact Us Now!
Stevie Gold Award Med Tech Award

SOC Audit HIPAA Audit HITECH Audit

Case Studies

White Papers


HIPAA Partners

Recent Posts

Get started with 12 months of free cloud VPS hosting

Free Tier includes:
G2.1GB Cloud VPS Server Free to Use for One Year
50 GB of Block Storage Free to Use for One Year
50 GB of Snapshots Free to Use for One Year

New York, NY

100 Delawanna Ave, Suite 1

Clifton, NJ 07014

United States

San Francisco, CA

2820 Northwestern Pkwy,

Santa Clara, CA 95051

United States

Dallas, TX

2323 Bryan Street,

Dallas, Texas 75201

United States

Ashburn, VA

1807 Michael Faraday Ct,

Reston, VA 20190

United States

Orlando, FL

440 W Kennedy Blvd, Suite 3

Orlando, FL 32810

United States

Toronto, Canada

20 Pullman Ct, Scarborough,

Ontario M1X 1E4


London, UK

14 Liverpool Road, Slough,

Berkshire SL1 4QZ

United Kingdom