Run the following commands:
sudo apt-get install python-software-properties sudo add-apt-repository ppa:webupd8team/java sudo apt-get update
Then,to install a specific jdk run these:
jdk6:
sudo apt-get install oracle-java6-installer
jdk7:
sudo apt-get install oracle-java7-installer
jdk8:
sudo apt-get install oracle-java8-installer原文链接:https://www.f2er.com/oracle/211056.html