I had java 7 installed. Using the PPA repository, I added java 8.
sudo apt-get install oracle-java8-installer
That made java 8 the default. So, I tried to use update-alternatives to make java 7 the default.
sudo update-alternatives --set java /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java
That causes
java -version
to fail.
It looks as if the problem might be that there is a long list of alternatives for java, and I need to move them all around together. is there a way?