I have a box running SonarQube scanner. The default JDK is 7.
I need to run sonar-runner
using JDK 8 but I would like to keep the default JDK at 7.
I tried changing JAVA_HOME
before running sonar-runner
but had no luck. I also couldn't find any properties that can change that.
Any thoughts?
Setting JAVA_HOME should work (see sonar-scanner source code if you're curious).
It's behaving well for me with SonarQube Scanner 2.6.1. Default on Java 7:
Forcing to Java 8:
Looking good. Note that the SonarQube Scanner for Jenkins has a built-in option to let you choose which JDK the scanner should use.