From bd5a646b76f4de1d2d788a81d8d11959096582e5 Mon Sep 17 00:00:00 2001 From: Stephan Saalfeld Date: Thu, 8 Oct 2020 16:50:51 -0400 Subject: [PATCH] Use --release flag to target intended JDK version Starting with Java 9, the --release flag makes it possible to compile Java code with a given version of the JDK but targeting an earlier version of the Java API. The --source and --target flags alone are not enough to guarantee this; the bootclasspath must also be set appropriately, which the --release flag takes care of doing. This change passes the value of the scijava.jvm.version property for --release, as long as the version of Java being used is 9 or later. With this enhancement, it is no longer necessary to restrict the build environment (scijava.jvm.build.version) to Java 8 only. This change could potentially be breaking for projects that override scijava.jvm.version with a version like 1.6, because the --release flag does not accept the 1.x syntax, only the new-style 6, 7, 8, etc. Therefore, we bump the major digit, to indicate that adjustment may be necessary in downstream POMs. Co-authored-by: Curtis Rueden --- pom.xml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index ab11af3..1f6daf4 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.scijava pom-scijava-base - 11.3.0-SNAPSHOT + 12.0.0-SNAPSHOT pom SciJava Base POM @@ -161,10 +161,10 @@ N/A - 1.8 + 8 ${scijava.jvm.version} - [1.8.0-101,1.8.9999] + [1.8.0-101,) ${scijava.jvm.version} ${scijava.jvm.version} ${scijava.jvm.test.version} @@ -2015,5 +2015,14 @@ 32 + + java-9 + + [9,) + + + ${scijava.jvm.version} + +