Change checkJavaVersion() startup check to support JDK 11.

This commit is contained in:
josecoll 2019-04-09 13:41:06 +01:00
parent ac56f302eb
commit 2a2fb6f82a

View File

@ -173,8 +173,8 @@ public class CordaCaplet extends Capsule {
private static void checkJavaVersion() {
String version = System.getProperty("java.version");
if (version == null || !version.startsWith("1.8")) {
System.err.printf("Error: Unsupported Java version %s; currently only version 1.8 is supported.\n", version);
if (version == null || Arrays.asList("1.8", "11").stream().noneMatch(version::startsWith)) {
System.err.printf("Error: Unsupported Java version %s; currently only version 1.8 or 11 is supported.\n", version);
System.exit(1);
}
}