Wednesday, September 5, 2012

Install Oracle Java 8 In Ubuntu VIa PPA [JDK8]

 
 
Oracle Java 8 is expected in summer 2013, but there are some early access builds available for download already. I've got a request to upload it to the WebUpd8 Java PPA, and I did so you can now easily install Oracle JDK 8 (includes JRE 8) in Ubuntu / Debian and derivatives.

Oracle Java 8 should only be used for testing purposes and/or by developers. Since this is a preview release, you'll encounter bugs!

As a reminder, the WebUpd8 Java PPA doesn't include any Java binaries, just a script that automatically downloads and install Oracle Java. Everything is done automatically so you'll get updates through the update manager for JDK8 which includes JRE8 and the Java browser plugin.

If you want to install Oracle Java 7 instead, see THIS post.
 

Install Oracle Java 8 (JDK8 and JRE8) in Ubuntu / Linux Mint


oracle java 8

Our PPA supports Ubuntu 12.10, 12.04, 11.10, 11.04, 10.10 and 10.04 as well as the corresponding Linux Mint versions. Add the PPA and install Oracle Java 8 (the package provides both JDK8 and JRE8) using the following commands:
 
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
Once installed, running "java -version" in a terminal should output something like this:

java -version
java version "1.8.0-ea"
Java(TM) SE Runtime Environment (build 1.8.0-ea-b54)
Java HotSpot(TM) Server VM (build 24.0-b21, mixed mode)
 Or, "javac -version":
javac -version
javac 1.8.0-ea
And so on.




Install Oracle Java 8 (both JDK8 and JRE8) in Debian


Debian users can install Oracle Java 8 from our PPA repository using the following commands:
 
su -
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" > 
/etc/apt/sources.list.d/webupd8team-java.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" >> 
/etc/apt/sources.list.d/webupd8team-java.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886
apt-get update
apt-get install oracle-java8-installer
exit

Switching between Oracle Java 8 and Java 7


Later on, if you want to switch Oracle Java 7, use the following command (make sure "oracle-java7-installer" package is installed):
 
sudo update-java-alternatives -s java-7-oracle

And, switch back to Oracle Java 8 using:

sudo update-java-alternatives -s java-8-oracle
If you get some warnings when running these two commands, ignore them.

 

 



 
 

No comments:

Post a Comment