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?
You can install oracle java8 jdk following this guide:
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
sudo apt-get update sudo apt-get install oracle-java8-installer
output should be:
java version "1.8.0_131"
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.