Use apt-get to install Java in a Debian Jessie

The “WebUpd8” team fortunately take care of some Packages that will make your life a little bit easier. In this case the Oracle Java (JDK) Installer!

First we need to add the WebUpd8 repository to our /etc/apt/sources.list

echo "deb trusty main" >> /etc/apt/sources.list
echo "deb-src trusty main" >> /etc/apt/sources.list

Then we get the Keys:
apt-key adv --keyserver hkp:// --recv-keys EEA14886

Lets update the new repositories
apt-get update

And thats it, now we can install Java with one simple apt-get
apt-get install oracle-java8-installer

Problems with the JAVA_HOME enviroment?
Take a look at