I'm trying to analyze a git project using SonarQube and running that through Jenkins, however the Console Output gives me an error when I try to build.
java.lang.UnsupportedClassVersionError: org/sonar/batch/bootstrapper/
EnvironmentInformation : Unsupported major.minor version 52.0
Screenshot -> http://i.imgur.com/Jb7Wngu.png
Which I have learned means I'm using a higher JDK at compile time than I am at runtime. When I ssh into the machine that is hosting Jenkins and the SonarQube server and run a
java -version
it outputs :
openjdk version "1.8.0_91"
OpenJDK Runtime Environment (build 1.8.0_91-b14)
OpenJDK 64-Bit Server VM (build 25.91-b14, mixed mode)
Which is what it should be-- SonarQube 5.6 needs Java 1.8 I believe?
Screenshot -> http://i.imgur.com/8wJzksI.png
But, I edit the Jenkins build to execute shell command at the beginning and had it run
java -version
and it outputted java version "1.7.0_79"
Screenshot -> i.imgur.com/ghGWpZx.png (near the bottom)
Can someone tell me what I'm doing wrong? How can I force Jenkins to use JDK 1.8? In my settings everything seems as if it is configured correctly
Screenshot -> i.imgur.com/3IXXEzg.png
[sorry, had to remove some hyperlinks since I don't have enough SO rep to post more than 2 links]
Thanks for your help