[FIX] Current Java 9+ javafx selector fix

This commit is contained in:
Gravita 2021-05-31 08:49:09 +07:00
parent 20a326a707
commit 8445ed2dca

View file

@ -187,7 +187,6 @@ public static Path tryGetOpenJFXPath(Path jvmDir) {
public static Path tryFindModule(Path path, String moduleName) { public static Path tryFindModule(Path path, String moduleName) {
Path result = path.resolve(moduleName.concat(".jar")); Path result = path.resolve(moduleName.concat(".jar"));
LogHelper.dev("Try resolve %s", result.toString());
if (!IOHelper.isFile(result)) if (!IOHelper.isFile(result))
result = path.resolve("lib").resolve(moduleName.concat(".jar")); result = path.resolve("lib").resolve(moduleName.concat(".jar"));
else return result; else return result;
@ -334,6 +333,10 @@ private static boolean isCurrentJavaSupportJavaFX() {
Class.forName("javafx.application.Application"); Class.forName("javafx.application.Application");
return true; return true;
} catch (ClassNotFoundException e) { } catch (ClassNotFoundException e) {
if (JVMHelper.getVersion() > 8) {
Path jvmDir = Paths.get(System.getProperty("java.home"));
return tryFindModule(jvmDir, "javafx.base") != null;
}
return false; return false;
} }
} }