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('.'))); } /**