Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does SonarQube support Java9?

The question is actually twofold:

  • Can Java9 projects be analysed with SonarQube?
  • Can SonarQube itself run on a Java9 JVM?

Same question for Java8

like image 573
ppeterka Avatar asked May 16 '17 12:05

ppeterka


People also ask

Can we use SonarQube for Java 8?

The only prerequisite for running SonarQube is to have Java (Oracle JRE 8 or OpenJDK 8) installed on your machine. Note: On Mac OS X it is highly recommended to install Oracle JDK 8 instead of the corresponding Oracle JRE since the JRE installation does not fully set up your Java environment properly.

What is SonarQube latest version?

SonarQube 8.9.10 LTS October 2022 - Long Term Support version, wrapping-up all the great features of 8.x series. (Developer-led Code Security, integrations for everyone & So.

Does SonarQube only analysis Java code?

SonarQube is an open source quality management platform, designed to analyze and measure your code's technical quality. It is used to test code written in the main programming languages such as C/C++, JavaScript, Java, C#, PHP, and Python, and even a combination of several languages simultaneously.


1 Answers

TL;DR: YES!!! It supports analysis, apparently since 3rd July 2017 (But they are desperately trying to hide the fact...)

As of now (2017-10-24, SonarQube version 6.6), SonarQube can analyse Java9 code using SonarJava 4.11 or newer, but running on a Java9 JVM is not officially supported.

SonarQube Java Plugin compatibility

The SonarJava page states it supports Java versions through 10:

Supported versions, frameworks and special analyses

  • Java language versions through 10

The SonarJava 4.11 release news also states:

The SonarSource Team is pleased to announce the release of SonarJava version 4.11.

This version introduces support for Java 9 projects. But what does that mean?

This means being able to parse the module-info.java source files introduced by the jigsaw project.

Also, same page explicitly lists support for:

  • Try-With-Resources enhancements
  • Interface private methods
  • Diamond Operator Extension
  • JaCoCo reports for Java9 classes

SonarQube platform compatibility

link

Supported Platforms

The SonarQube Java analyzer is able to analyze any kind of Java source files regardless of the version of Java they comply to. But SonarQube analysis and the SonarQube Server require specific versions of the JVM.

Support:

  • Oracle JRE 7 ❌
  • Oracle JRE 8 ✓
  • Oracle JRE 9 ❌
  • OpenJDK 7 ❌
  • OpenJDK 8 ✓
  • OpenJDK 9 ❌
  • IBM JRE ❌
  • GCJ ❌
  • Oracle JRockit ❌

Links:

  • SonarQube JIRA queue for search string "java 9"
  • SonarQube JIRA queue for search string "java9"
  • SonarQube JIRA ticket "MMF-833: Make SonarJava supporting the analyzis of Java 9 projects"
like image 99
ppeterka Avatar answered Sep 27 '22 01:09

ppeterka