timefold-solver
timefold-solver copied to clipboard
If the JVM version is too low, show a simple, clean error message
To reproduce:
sdk java use 11.2.3-tem (or whatever is the latest today)
cd school-timetabling
mvn quarkus:dev
Result:
File "org.jpype.pkg.JPypePackage.java", line -1, in org.jpype.pkg.JPypePackage.getObject
Exception: Java Exception
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "org.jpype.pkg.JPypePackage.java", line -1, in org.jpype.pkg.JPypePackage.getObject
java.lang.java.lang.UnsupportedClassVersionError: java.lang.UnsupportedClassVersionError: ai/timefold/jpyinterpreter/CPythonBackedPythonInterpreter has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0
... man more lines
Desired, something like (feel free to adjust):
Timefold Solver for Python requires JVM (java) version 17 or later. Your JVM version (11.2.3) is not supported.
Maybe use sdkman (https://sdkman.io) to install a more modern version of Java.
Similarly, if no java is installed at all, it should output something like:
Timefold Solver for Python requires JVM (java) version 17 or later. You have none installed.
Maybe use sdkman (https://sdkman.io) to install a modern version of Java.