Question about upgrade to SQ 10.4 and Java versions

Hi, we are trying to update Sonar Qube
to 10.4 version, that needs java 17. it does not support with java 11, shall we compile and run java builds with java 11 and sonar scanner with java 17 is it possible , will not impact for the codebase?

Hello,

I wonder how you can try to upgrade your server to SQ 10.4 as of now (22nd of Jan) while it has not yet been released. There is certainly a misunderstanding somewhere when you are talking about versions.

What is sure is that with SQ 10.4, you will be required to use Java 17 to start your code scan.
It means you will have to split your task like this:

  • first you compile your Java code with Java11
  • second, you just run the mvn sonar:sonar under a Java17 context

Said differently, while before it was possible to just do:

mvn clean verify sonar:sonar

Now you need to:

JAVA_HOME = Java11
mvn clean verify
JAVA_HOME = Java17
mvn sonar:sonar

The SonarQube 10.4 documentation will contain more details.

Alex

1 Like

Yes alex , I misunderstood we are upgrading SonarQube to 10.4 , not the server.
Thanks for your information.

Hello,

I’m sorry, I’ll have to insist because what you wrote shows that there is something still not clear on your side.

SonarQube 10.4 has not yet been released as of today. SonarQube is the server part.
What you have to upgrade to move from Java11 to Java17 is the client side, which is called the SonarScanner which is the part used to start the code scan.

Alex

Thanks Alex, for your useful information.
One question we can run and compile builds using java 8 or java 11? for sonar scanner java 17.
It will not impact any codebase right.

Hello,

I confirm you can build your Java code with whatever version of Java you want (Java8, Java11 or even older versions).

It’s only required to use Java17 when you run the Sonar scan.

Alex

Hi Alex,
We are facing this issue while working with java 17 for sonar scanner
“java.lang.reflect.InaccessibleObjectException: Unable to make private java.io.File(java.lang.String,java.io.File) accessible: module java.base does not “opens java.io” to unnamed module @12f40c25
how to pass --add-opens to java 17 in gradle build

Thanks

A post was split to a new topic: Problem building with Java 8 & analyzing with J11