I am running a build with sonarqube 4.5.1 and JDK 6. I am getting this following error:
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project test-util: The plugin java is not supported with Java 1.6.0_26: org/sonar/plugins/java/JavaPlugin : Unsupported major.minor version 51.0
I found one document on internet which says that JDK 6 is no longer supported to run SonarQube starting from 4.5.1.
Could anyone please confirm , if this error message is because JDK 6 is no longer supported with sonarqube 4.5.1?
Thanks in advance.
Yes, you need JDK 7 or later (see How to fix: Unsupported major.minor version 51.0 error?).
You can still build your project with JDK 6, but SonarQube analysis should be executed by JDK 7 or later.
You can run Sonar 4.5.1 version with jdk1.6 , provided you give a sonar-maven-plugin jar which is compatible with java6.
sonar-maven-plugin version 2.4 is not compatible with java 6 and it works with java 7.
We are also doing the same, compiling the project with Java 6 and running sonar analysis with Java 7.
Can anyone provide the sonar-maven-plugin version < 2.4 which is compatible with java 6.
As of now i am trying with sonar-maven-plugin 2.3.1 but don't know whether it will work, will update the result soon.
Related
I am unable to start the sonarqube in my local windows machine, Getting the below error,
I have set java path and it's working fine,
Regarding to the https://docs.sonarqube.org/8.6/requirements/requirements/ which describes as the following: -
Prerequisite
The only prerequisite for running SonarQube is to have Java (Oracle JRE 11 or OpenJDK 11) installed on your machine.
Supported Platforms
Java
SonarQube scanners require version 8 or 11 of the JVM
SonarQube server requires version 11. Versions beyond Java 11 are not officially supported.
Then this is a root cause why we face this failure message when we run it against the JDK version 8
I would suggest to download the JDK version 11 and use it so that we meet the SonarQube Server requirement.
How to avoid issue with sonar scanner plugin on Jenkins 2.289.2, plugin sonar 2.13.1
when compiling a project I got the error
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.0.2155:sonar (default-cli) on project maven-project:
Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.0.2155:sonar failed:
An API incompatibility was encountered while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.0.2155: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
It looks like an issue with the version of java but I would like to avoid changing my java version
Probably the compiled code you trying to run was compiled using java 11, but in env installed only java 8.
Try to install java 11 and make sure to update OS environment settings to point to the new JDK.
Java Details:
Java 8 uses major version 52
Java 11 uses major version 55
I am trying to integrate sonarqube gradle plugin with jdk7 but build is failing due to version mismatch.
Gralde version 4.3
JDK 1.7
Sonarqube-gradle plugin ??
2.0.1 was the last version to support Java 7
https://github.com/SonarSource/sonar-scanner-gradle/releases/tag/2.0.1
https://github.com/SonarSource/sonar-scanner-gradle/blob/2.0.1/build.gradle#L24..L25
When I run mvn pmd:check with JAVA_HOME set to jdk 1.8, this runs smoothly. When I switch the jdk to 1.7 I get following exception.
PMD support 1.7, so not sure why I am getting this error.
Caused by: org.apache.maven.plugin.PluginContainerException: An API incompatibility was encountered while executing org.apache.maven.plugins:maven-pmd-plugin:3.8:pmd: java.lang.UnsupportedClassVersionError: : Unsupported major.minor version 52.0
Anybody faced the same issue?
52.0 is Java 8. This meant that I was somehow trying to run Java 8 code in a Java 7 VM. Eventhough my jdk and JAVA_HOME was set to 7.
The pmd plugin I was using was version 3.8 , which seems to support jdk 8+.
I downgraded my maven-pmd-plugin to 3.7. And the exception went away.
That's weird. PMD is still working with JDK7 - as is maven. JDK8 is only required, if you want to analyze Salesforce.com Apex code.
Would you mind running mvn with the -e or -X option, to see which class is for java8? You should get a stacktrace then. It might be caused by a dependency.
Also: Which version of maven are you using?
The problem discussed in
JaCoCo SonarQube incompatible version 1007
is happening again with sonarqube-maven-plugin 2.7.1 in combination with jacoco-maven-plugin 0.7.5.201505241946
Executing sonar:sonar results in
java.io.IOException: Incompatible version 1007.
According to https://jira.sonarsource.com/browse/SONARJAVA-1091 this should be fixed already.
The java plugin in my SQ-Server installation is version 3.3.
Can anyone confirm this?
The issue you are encoutering comes from a binary incompatiblity due to latest version of JaCoCo binary report. This issue has been fixed in version 3.4 of the sonar-java-plugin : https://jira.sonarsource.com/browse/SONARJAVA-1091
Please update your plugin version, it should solve the issue.