I have installed latest version of SonarQube using Java 11 pointed from its config i.e. wrapper.config
. I have read that it can analyze code even written in Java 8, but I am getting following exception:
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.8.0.2131:sonar (default-cli) on project ptf-parent: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.8.0.2131:sonar failed: An API incompatibility was encountered while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.8.0.2131:sonar: java.lang.UnsupportedClassVersionError: org/sonar/batch/bootstrapper/EnvironmentInformation has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
Currently, my code is build using Java 8 and I want to analyze using the latest SonarQube version.
I am running analyzer from Eclipse IDE. All my projects are configured to use Java 8 and Maven 3.8.2 to use sonar parameters to push report on SonarQube, but it does not work.
Below are the parameters I am providing in Eclipse Run as Maven build:
-e clean install sonar:sonar -Dsonar.java.jdkHome=C:\Program Files\Java\jdk1.8.0_251 -Dsonar.project
-Dsonar.projectKey=TESTPROJECT -Dsonar.host.url=http://localhost:9000 -Dsonar.login=a2603f6cd079e4a7833179333333333333333333e