Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions java/src/processing/mode/java/runner/Runner.java
Original file line number Diff line number Diff line change
Expand Up @@ -774,10 +774,11 @@ public static boolean handleCommonErrors(final String exceptionClass,
err.println("and your code should be rewritten in a more efficient manner.");

} else if (exceptionClass.equals("java.lang.UnsupportedClassVersionError")) {
int javaVersion = Runtime.version().feature();
listener.statusError("UnsupportedClassVersionError: A library is using code compiled with an unsupported version of Java.");
err.println("This version of Processing only supports libraries and JAR files compiled for Java 1.8 or earlier.");
err.println("A library used by this sketch was compiled for Java 1.9 or later, ");
err.println("and needs to be recompiled to be compatible with Java 1.8.");
err.println("This version of Processing only supports libraries and JAR files compiled for Java " + javaVersion + " or earlier.");
err.println("A library used by this sketch was compiled for Java " + (javaVersion + 1) + " or later, ");
err.println("and needs to be recompiled to be compatible with Java " + javaVersion + ".");

} else if (exceptionClass.equals("java.lang.NoSuchMethodError") ||
exceptionClass.equals("java.lang.NoSuchFieldError")) {
Expand Down