0

Jenkins and Sonarqube both are running on docker.

I try to integrate the jenkins with the sonarqube....in this i success. but i fail in getting the report and it should be share with sonarqube.

Below cmd are run on the jenkins container.

/opt/java/openjdk/bin/java
root@4739e7c62757:~/jdk-20/bin# java -version
openjdk version "11.0.18" 2023-01-17
OpenJDK Runtime Environment Temurin-11.0.18+10 (build 11.0.18+10)
OpenJDK 64-Bit Server VM Temurin-11.0.18+10 (build 11.0.18+10, mixed mode)

When I try to run the jenins job.It get fails and getting an issue as below. Below are part of jenkins console log.

INFO: Scanner configuration file: /var/jenkins_home/sonar-scanner-3.3.0.1492-linux/conf/sonar-scanner.properties
INFO: Project root configuration file: /var/jenkins_home/workspace/sonar_int_jenkins/sonar-project.properties
INFO: SonarQube Scanner 3.3.0.1492
INFO: Java 1.8.0_121 Oracle Corporation (64-bit)
INFO: Linux 5.4.0-144-generic amd64
INFO: User cache: /root/.sonar/cache
INFO: SonarQube server 9.9.0.65466
INFO: Default locale: "en", source code encoding: "UTF-8"
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 0.596s
INFO: Final Memory: 5M/241M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
ERROR: 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
ERROR: 
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
WARN: Unable to locate 'report-task.txt' in the workspace. Did the SonarScanner succeed?
ERROR: SonarQube scanner exited with non-zero code: 1
Finished: FAILURE

Please let us know if any addition details are required to solve this issue.

Thanks is advance.

  • Sonarqube requires Java 11 for the analysis. so for sonar analysis us e java 11 – seenukarthi Mar 28 '23 at 12:22
  • @seenukarthi: java 11 is installed on the jenkins container. Please check once again and let me know if any details required. – Vishnu Kumar Mar 28 '23 at 12:46
  • The log for the SonarQube Scanner says "Java 1.8.0_121 Oracle Corporation (64-bit)" - which shows that it is running with Java 1.8. Note that `-Dsonar.java.jdkHome=/root/jdk-20/bin/java` seems wrong - `/root/jdk-20/bin/java` seems to be the path of the java executable which is **not** a valid jdkHome value. Probably you should change that to `-Dsonar.java.jdkHome=/root/jdk-20` – Thomas Kläger Mar 28 '23 at 13:12
  • @ThomasKläger: changed path ```/root/jdk-20``` but error remain same. – Vishnu Kumar Mar 28 '23 at 13:18
  • https://docs.sonarqube.org/8.9/analyzing-source-code/moving-analysis-to-java-11/ check this document. – seenukarthi Mar 29 '23 at 05:55

0 Answers0