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 (PPA for Ubuntu 13.04, 12.10, 12.04, 11.10, 11.04 and 10.04).
Install Oracle Java 8 (JDK8 and JRE8) in Ubuntu / Linux Mint
Our PPA supports Ubuntu 13.04, 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:
Or, "javac -version":
andrei@andrei-desktop:~$ 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)
And so on.
andrei@andrei-desktop:~$ javac -version javac 1.8.0-ea
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" | tee -a /etc/apt/sources.list echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.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:
If you get some warnings when running these two commands, ignore them.
sudo update-java-alternatives -s java-8-oracle
Setting Java environment variables
To automatically set up the Java 8 environment variables, you can install the following package:
sudo apt-get install oracle-java8-set-default
If you've already installed oracle-java6-set-default or oracle-java7-set-default, they will be automatically removed when installing oracle-java8-set-default (and the environment variables will be set for Oracle Java 8 instead).