Installing Java 8 on Ubuntu 14 LTS
Installing Using a PPA
To install Java on oracle, the preferred way is to use apt-get install, however the default installation does not include Java8, because of its licensing. To get around that you need to first add a new repository for apt-get to pull from, and then update apt-get in order for that repository to become usable. Once you have finished that, you can use apt-get to install Java as normal. We are using WebUpd8 PPA to allow apt-get to install the Oracle version of the JDK, and we are going to install Java 8.
Here are the steps:
sudo apt-add-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java8-installer
For reference, you may want to read Are PPA’s safe to add to my system and what are some “red flags” to watch out for? to better understand PPAs.
Next, ensure your JAVA_HOME
variable is set correctly or else Java will not function. To do so, you can add this line to your .bash_profile:
export JAVA_HOME=/usr/lib/jvm/java-8-oracle