C++ plugin compatibility issue with Java version

Hi Team,

We have recently migrated our SQ application from 7.1 to 7.9.6 LTS.
In older setup (SQ 7.1), we were using cxx plugin with version 1.0.0 and it was working as expected.
Since cxx 1.0.0 is not compatible with SQ version 7.9.6, we have updated cxx plugin version to 2.0.4.

Since we have updated plugin version, we are getting java compatibility issue as below:

2021-08-30T09:07:15.833754637Z [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin: (default-cli) on project rc-pipeline: The plugin [cxx] does not support Java 1.8.0_181: org/sonar/plugins/cxx/CxxPlugin 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 -> [Help 1]
2021-08-30T09:07:15.833802573Z [ERROR]

Here, please note that source code is at JAVA 8 version and before plugin version update, we were not getting any error.
Even though we have disabled this plugin from UI, it’s still getting referenced during sonar analysis execution. Attaching snap of it for the reference.

Can someone please help me resolve the issue ?

Also, please let me know how we can ensure that specific plugin will not be considered for specific project during sonar analysis execution (If that is possible).

Vaibhav Jariwala

Hey there.

As this is strictly related to SonarOpenCommunity/sonar-cxx (a third-party plugin not developed, maintained or supported by SonarSource or this community), I would recommend raising with the maintainer for support.

Thanks @Colin
I will check in that forum.

Hi @Colin ,
I got response from maintainer of cxx plugin(C++ plugin compatibility issue with Java 8 version · Issue #2239 · SonarOpenCommunity/sonar-cxx · GitHub) as below:

The SonarQube Java plugin should run under Java 11 and Java 8. The used Java VM has nothing to do with the supported source code versions. You have to read in the Java plugin manual from SonarQube which source code versions are supported.

As I checked in configured SQ 7.9.6, sonar java plugin exists with version 6.3.2 (build 22818)
Attaching the snap of the same for the reference.

May I know the if sonar java plugin (version :6.3.2 (build 22818)) is compatible and supports java 8 ?

Vaibhav Jariwala

Yes, this version supports analysing Java 8.

Thanks @Colin for confirmation.

Closing comment:
For cxx plugin 2.x, sonar scanner and sonar server should have java 11 whereas source code of the project can be at java 8.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.