Error sending analysis to SonarQube with JDK 10


(Carlos Hortelano) #1

Hi,

From Jenkins I’ve compiled with a Java project using Maven and JDK 10 and, then, I’m trying to launch a SonarQube analysis using SonarQube Scanner and specifying, in Jenkins, this same version of Java. When launching the analysis, I’m obtaining this error:

Could not find class com.everis.edms.core.model.Document, due to: java.lang.UnsupportedClassVersionError: com/everis/edms/core/model/Document has been compiled by a more recent version of the Java Runtime (class file version 54.0), this version of the Java Runtime only recognizes class file versions up to 52.0

My environment is the following:

  • SonarQube Server: 6.7.1
  • SonarQube scanner version: 3.0.3

Is my version of SonarQube compatible with Java 10? Why, if I’m specifying the scanner to be launched with a specific version of Java (10), am I obtaining this error?

Regards.


(Carlos Hortelano) #2

Anyone helping me with this?


(Colin Mueller) #3

Carlos,

This is an open community forum and you should probably wait longer than 10 hours before bumping a thread. :slight_smile:

That said, using the search function on this forum to search for “JDK 10”… it looks like the ability to perform an analysis with JDK 10 should be supported but you might need to make sure you’re on the most recent version of SonarJava. What version of SonarJava are you using today?

Colin


(Carlos Hortelano) #4

Hi @ColinHMueller,

Thanks for your answer. Currently, I’m using v5.3 of SonarJava plugin.


(Carlos Hortelano) #5

Hi,

I’ve tested running the SonarQube analysis with version 5.3 (because the execution of sonar in other job is failing if I use version 5.7) of SonarJava plugin, but the error remains the same. This is the situation of my environment right now:

Maven: 3.2.1, and Java 10 selected.
Sonar Scanner: 3.0.3, and Java 10 selected.
SonarQube Server: 6.7, running over Java 8.

Do I need to run SonarQube Server with Java 10 to make the analysis run correctly?

Regards.


(Tibor Blenessy) #6

Hello @chortels ,

to be able to analyze Java 10 you will need to update your SonarJava plugin on SonarQube. If you have some failure related to this upgrade, you can create new topic with all the relevant details and we can try to help you to resolve it.

Cheers