Ubuntut 14.04 LTS
According to this I need JAVA 8 and so I downloaded both the JDK and JRE. Unfortunately when attempting to install jenkins again
sudo apt-get install jenkins
I still get the error message
Aborting
invoke-rc.d: initscript jenkins, action "stop" failed.
dpkg: error processing archive /var/cache/apt/archives/jenkins_2.176.2_all.deb (--unpack):
subprocess new pre-removal script returned error exit status 1
Found an incorrect Java version
Java version found:
java version "1.7.0_201"
OpenJDK Runtime Environment (IcedTea 2.6.17) (7u211-2.6.17-0ubuntu0.1)
OpenJDK 64-Bit Server VM (build 24.201-b00, mixed mode)
Checking my $PATH and it shows the following
/usr/lib/jvm/jre1.8.0_221/bin:/usr/lib/jvm/jdk1.8.0_211/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
The java that should be used is 8. Even running
java -version
Gives me what I expect
java version "1.8.0_221"
Java(TM) SE Runtime Environment (build 1.8.0_221-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.221-b11, mixed mode)
Why do I get the java version error if I have JAVA 8 installed? What more do I have to do to ensure that JAVA 8 is the default?
I was unsuccessful in trying
sudo apt-get install openjdk-8-jre
and got
Unable to locate package openjdk-8-jre
Side note, when attempting to run eclipse from the side bar I get an error about the JAVA version as well. Running eclipse from command line works fine though.
Does it have to with default-java symbolic link in my /usr/lib/jvm folder? It points to the Java 7 openjdk... Doing ls -la shows the links
default-java -> java-1.7.0-openjdk-amd64
java-1.7.0-openjdk-amd64 -> java-7-openjdk-amd64
java-7-openjdk-amd64