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