How can I install JDK 8? Is it possible to install it from PPA?
2 Answers
You can install it from PPA :
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
Or download it from here then move jdk-8*
to /usr/lib/jvm/jdk1.8.x
then run these commands:
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.x/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.8.x/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.8.x/bin/javaws" 1
sudo chmod a+x /usr/bin/java
sudo chmod a+x /usr/bin/javac
sudo chmod a+x /usr/bin/javaws
x
in 1.8.x
means the latest version of JDK 8
-
1Why do you need the
python-software-properties
package? Commented Feb 22, 2016 at 19:19 -
Can not comment to previous answer: "Why do you need the python-software-properties package? – codehitman " You need it in case you get following error: add-apt-repository: command not found You might also need: sudo apt-get install software-properties-common– ilia.anCommented Dec 30, 2016 at 7:14
sudo apt install software-properties-common
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer