This is an automated email from the ASF dual-hosted git repository. jtulach pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-netbeans-html4j.git
commit 0957c5b62cf29dab7c89b3761792078541b761d2 Author: Jaroslav Tulach <[email protected]> AuthorDate: Tue Sep 18 05:44:03 2018 +0200 Only ask for the Method addURL when the lib/jfxrt.jar file exists --- boot-fx/src/main/java/org/netbeans/html/boot/fx/FXGCPresenter.java | 4 ++-- boot-fx/src/main/java/org/netbeans/html/boot/fx/FXPresenter.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/boot-fx/src/main/java/org/netbeans/html/boot/fx/FXGCPresenter.java b/boot-fx/src/main/java/org/netbeans/html/boot/fx/FXGCPresenter.java index 330b13a..03f1594 100644 --- a/boot-fx/src/main/java/org/netbeans/html/boot/fx/FXGCPresenter.java +++ b/boot-fx/src/main/java/org/netbeans/html/boot/fx/FXGCPresenter.java @@ -41,10 +41,10 @@ public final class FXGCPresenter extends AbstractFXPresenter { Class<?> c = Class.forName("javafx.application.Platform"); // OK, on classpath } catch (ClassNotFoundException classNotFoundException) { - Method m = URLClassLoader.class.getDeclaredMethod("addURL", URL.class); - m.setAccessible(true); File f = new File(System.getProperty("java.home"), "lib/jfxrt.jar"); if (f.exists()) { + Method m = URLClassLoader.class.getDeclaredMethod("addURL", URL.class); + m.setAccessible(true); URL l = f.toURI().toURL(); m.invoke(ClassLoader.getSystemClassLoader(), l); } diff --git a/boot-fx/src/main/java/org/netbeans/html/boot/fx/FXPresenter.java b/boot-fx/src/main/java/org/netbeans/html/boot/fx/FXPresenter.java index 1554113..4777a86 100644 --- a/boot-fx/src/main/java/org/netbeans/html/boot/fx/FXPresenter.java +++ b/boot-fx/src/main/java/org/netbeans/html/boot/fx/FXPresenter.java @@ -41,10 +41,10 @@ public final class FXPresenter extends AbstractFXPresenter { Class<?> c = Class.forName("javafx.application.Platform"); // OK, on classpath } catch (ClassNotFoundException classNotFoundException) { - Method m = URLClassLoader.class.getDeclaredMethod("addURL", URL.class); - m.setAccessible(true); File f = new File(System.getProperty("java.home"), "lib/jfxrt.jar"); if (f.exists()) { + Method m = URLClassLoader.class.getDeclaredMethod("addURL", URL.class); + m.setAccessible(true); URL l = f.toURI().toURL(); m.invoke(ClassLoader.getSystemClassLoader(), l); } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
