10

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

2 Answers 2

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

2
  • 1
    Why do you need the python-software-properties package?
    – codehitman
    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.an
    Commented Dec 30, 2016 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
1
  • Why python-software-properties?
    – bigbang
    Commented Oct 9, 2017 at 8:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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