Java 12 support

It’s been a while since JDK 12 was released, but I’m still getting this exception with Sonar Maven plugin (org.sonarsource.scanner.maven:sonar-maven-plugin:3.6.0.1398):

Caused by: java.lang.NumberFormatException: For input string: "12-ea"
    at java.lang.NumberFormatException.forInputString (NumberFormatException.java:68)
    at java.lang.Integer.parseInt (Integer.java:658)
    at java.lang.Integer.parseInt (Integer.java:776)
    at com.google.gson.util.VersionUtils.determineMajorJavaVersion (VersionUtils.java:28)
    at com.google.gson.util.VersionUtils.<clinit> (VersionUtils.java:24)
    at com.google.gson.internal.reflect.ReflectionAccessor.<clinit> (ReflectionAccessor.java:36)
    at com.google.gson.internal.ConstructorConstructor.<init> (ConstructorConstructor.java:51)
    at com.google.gson.Gson.<init> (Gson.java:205)
    at com.google.gson.Gson.<init> (Gson.java:185)
    at org.sonar.scanner.bootstrap.ScannerPluginInstaller.listInstalledPlugins (ScannerPluginInstaller.java:108)
    at org.sonar.scanner.bootstrap.ScannerPluginInstaller.loadPlugins (ScannerPluginInstaller.java:78)
    at org.sonar.scanner.bootstrap.ScannerPluginInstaller.installRemotes (ScannerPluginInstaller.java:62)
    at org.sonar.scanner.bootstrap.ScannerPluginRepository.start (ScannerPluginRepository.java:59)

Am I doing something wrong or still JDK isn’t supported?

Hi,

Welcome to the community. :slight_smile:

We target the LTS versions of Java for support, so primarily Java 11 right now. You should downgrade your JDK.

 
Ann

Anyway, I’m running JDK 12 on my PC and everything works correctly. The 12-ea string indicates that you’re running an early access build of JDK 12, not an “official” release.

2 Likes

Thanks for the information @felipebz. Looks like the scanner is having trouble parsing the java version with early access releases.

Please try with an official release and if you find any problems we will try to fix them in upcoming releases. As Ann mentioned, we only guarantee (and test) support of Java 11.

Hi,

As a followup, this fix ticket is included in 8.0, ETA end of Sept.

 
Ann

1 Like