引用webupd8官方介绍 http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html
To add our PPA and install the latest Oracle Java 7 in Ubuntu (supports Ubuntu 13.10, 13.04, 12.10, 12.04 and 10.04) or Linux Mint
安装:
sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java8-installer
安装后查看版本:
$ java -version java version "1.8.0-ea" $ javac -version javac 1.8.0-ea
Debian安装Oracle Java 8 ( JDK8 和 JRE8)
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
在Oracle Java 8 和 Java 7 间切换:
sudo update-java-alternatives -s java-7-oracle sudo update-java-alternatives -s java-8-oracle
卸载
sudo apt-get remove oracle-java8-installer