Make error message dynamic

This commit is contained in:
Nico Mexis
2025-06-01 15:54:29 +02:00
parent 1f6928462d
commit 34a85d82db

View File

@@ -774,10 +774,11 @@ public class Runner implements MessageConsumer {
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 17 or earlier.");
err.println("A library used by this sketch was compiled for Java 18 or later, ");
err.println("and needs to be recompiled to be compatible with Java 17.");
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")) {