From: Julien Lancelot Date: Wed, 4 Dec 2019 12:04:53 +0000 (+0100) Subject: SONAR-12770 Do not let people think that a Java version > 11 is officially supported X-Git-Tag: 7.9.2~2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6bb15a7a392e5da7c0e81ad3faf9d643c6dd1cc5;p=sonarqube.git SONAR-12770 Do not let people think that a Java version > 11 is officially supported --- diff --git a/sonar-application/src/main/java/org/sonar/application/App.java b/sonar-application/src/main/java/org/sonar/application/App.java index c37aff811d4..92f8881abbd 100644 --- a/sonar-application/src/main/java/org/sonar/application/App.java +++ b/sonar-application/src/main/java/org/sonar/application/App.java @@ -32,6 +32,7 @@ import org.sonar.core.extension.ServiceLoaderWrapper; import org.sonar.process.System2; import org.sonar.process.SystemExit; +import static com.google.common.base.Preconditions.checkState; import static org.sonar.application.config.SonarQubeVersionHelper.getSonarqubeVersion; import static org.sonar.process.ProcessProperties.Property.CLUSTER_NAME; @@ -88,10 +89,7 @@ public class App { if (MetadataLoader.loadEdition(org.sonar.api.utils.System2.INSTANCE) == SonarEdition.SONARCLOUD) { return; } - - if (!javaVersion.isAtLeastJava11()) { - throw new IllegalStateException("SonarQube requires Java 11+ to run"); - } + checkState(javaVersion.isAtLeastJava11(), "SonarQube requires Java 11 to run"); } public static void main(String[] args) throws Exception { diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalContainer.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalContainer.java index 87f69aad2a8..8be6fb7cef7 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalContainer.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalContainer.java @@ -83,7 +83,7 @@ public class GlobalContainer extends ComponentContainer { try { String.class.getMethod("isBlank"); } catch (NoSuchMethodException e) { - LOG.warn("SonarScanner will require Java 11+ to run starting in SonarQube 8.x"); + LOG.warn("SonarScanner will require Java 11 to run starting in SonarQube 8.x"); } }