0

I started getting errors on my pi from running a java program that should run on java 8, which i thought i had on my pi, so i did java -version on my pi and it turns out I have java 7 installed (java version "1.7.0_131"). Any idea how to use java 8 on it?

asked Jul 28, 2017 at 13:45

2 Answers 2

1

You can install oracle java8 jdk following this guide:

  1. modify /etc/apt/sources.list file

    sudo nano /etc/apt/sources.list
    

    adding this lines:

    deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main 
    deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
    
  2. install jdk

    sudo apt-get update
    sudo apt-get install oracle-java8-installer
    
  3. verify installation

    java -version
    

    output should be:

    java version "1.8.0_131"
    
answered Jul 28, 2017 at 14:36
0

Oops... I did some digging and found that you can do "sudo update-alternatives --config java", and select the number corresponding to java 8. It will probably have jdk8 in its path.

answered Jul 28, 2017 at 13:51

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.