Let File.toURL() handle the / and \
authorjarda@tonda-ws
Fri, 23 Jan 2004 17:10:49 +0100
changeset 2188a8d61db084c
parent 217 3f94a09bea35
child 220 e15f602dabc0
Let File.toURL() handle the / and \
boot-fx/src/main/java/org/apidesign/html/boot/fx/FXPresenter.java
     1.1 --- a/boot-fx/src/main/java/org/apidesign/html/boot/fx/FXPresenter.java	Mon Jul 29 17:55:44 2013 +0200
     1.2 +++ b/boot-fx/src/main/java/org/apidesign/html/boot/fx/FXPresenter.java	Fri Jan 23 17:10:49 2004 +0100
     1.3 @@ -21,6 +21,7 @@
     1.4  package org.apidesign.html.boot.fx;
     1.5  
     1.6  import java.io.BufferedReader;
     1.7 +import java.io.File;
     1.8  import java.io.Reader;
     1.9  import java.lang.reflect.Method;
    1.10  import java.net.URL;
    1.11 @@ -73,9 +74,11 @@
    1.12              } catch (ClassNotFoundException classNotFoundException) {
    1.13                  Method m = URLClassLoader.class.getDeclaredMethod("addURL", URL.class);
    1.14                  m.setAccessible(true);
    1.15 -                URL l = new URL("file://" + System.getProperty("java.home") + "/lib/jfxrt.jar");
    1.16 -    //            LOG.log(Level.INFO, "url : {0}", l);
    1.17 -                m.invoke(ClassLoader.getSystemClassLoader(), l);
    1.18 +                File f = new File(System.getProperty("java.home"), "lib/jfxrt.jar");
    1.19 +                if (f.exists()) {
    1.20 +                    URL l = f.toURI().toURL();
    1.21 +                    m.invoke(ClassLoader.getSystemClassLoader(), l);
    1.22 +                }
    1.23              }
    1.24          } catch (Exception ex) {
    1.25              throw new LinkageError("Can't add jfxrt.jar on the classpath", ex);