From 57c05e2ad67d1df0a7554fd9eb6986ae38cca2d9 Mon Sep 17 00:00:00 2001 From: Mathias Herberts Date: Sun, 19 Aug 2018 12:15:29 +0200 Subject: [PATCH] Fixed for JEP-223 support --- core/src/processing/core/PApplet.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/processing/core/PApplet.java b/core/src/processing/core/PApplet.java index 5d099759c9..4f0a888e61 100644 --- a/core/src/processing/core/PApplet.java +++ b/core/src/processing/core/PApplet.java @@ -119,8 +119,11 @@ public class PApplet implements PConstants { String version = javaVersionName; if (javaVersionName.startsWith("1.")) { version = version.substring(2); + javaPlatform = parseInt(version.substring(0, version.indexOf('.'))); + } else { + // Remove -xxx and .yyy from java.version (@see JEP-223) + javaPlatform = parseInt(version.replaceAll("-.*","").replaceAll("\\..*","")); } - javaPlatform = parseInt(version.substring(0, version.indexOf('.'))); } /**