Add initialization error when running in Substrate VM

This commit is contained in:
JeremyStar™ 2024-09-21 17:22:17 +02:00
parent 0fed87328a
commit a00fdea6f5
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D

View file

@ -253,6 +253,22 @@ public final class Engine extends SubsystemClass {
if (JvmInformation.getJavaVersion() > EngineInformation.getJavaSource()) if (JvmInformation.getJavaVersion() > EngineInformation.getJavaSource())
logger.warn("The StarOpenSource Engine is running on an untested Java version.\nThings may not work as expected or features which can improve performance, stability, compatibility or ease of use may be missing.\nIf you encounter issues, try running a JVM implementing Java " + EngineInformation.getJavaSource()); logger.warn("The StarOpenSource Engine is running on an untested Java version.\nThings may not work as expected or features which can improve performance, stability, compatibility or ease of use may be missing.\nIf you encounter issues, try running a JVM implementing Java " + EngineInformation.getJavaSource());
// Shutdown if running in an unsupported JVM
if (JvmInformation.getImplementationName().equals("Substrate VM") && JvmInformation.getImplementationVendor().equals("GraalVM Community")) {
logger.error("##############################################################################################");
logger.error("## Running in Substrate VM, which is the name of the JVM generated by GraalVM native-image. ##");
logger.error("## The StarOpenSource Engine does not support native-image as using reflection in a certain ##");
logger.error("## way seems to cause the Substrate JVM to crash. Workarounds have failed. ##");
logger.error("## This has already been noted in issue #3, which you can view here: ##");
logger.error("## https://git.staropensource.de/StarOpenSource/Engine/issues/3 ##");
logger.error("## 2 ##");
logger.error("## While this is sad, we unfortunately can't do anything against it unless we introduce ##");
logger.error("## annoying and stupid changes into the engine, which we don't want to do. ##");
logger.error("## ##");
logger.error("## We're truly sorry for this inconvenience. The sos!engine will now terminate. ##");
logger.error("##############################################################################################");
Runtime.getRuntime().exit(255);
}
// Check if reflective classpath scanning is supported // Check if reflective classpath scanning is supported
if (checkClasspathScanningSupport()) { if (checkClasspathScanningSupport()) {