9

How can I install JDK 8? Is it possible to install it from PPA?

13

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

  • 1
    Why do you need the python-software-properties package? – codehitman Feb 22 '16 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.an Dec 30 '16 at 7:14
1
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
  • Why python-software-properties? – bigbang Oct 9 '17 at 8:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.