diff options
Diffstat (limited to 'libjava/gnu')
-rw-r--r-- | libjava/gnu/gcj/runtime/FirstThread.java | 10 | ||||
-rw-r--r-- | libjava/gnu/gcj/runtime/VMClassLoader.java | 11 |
2 files changed, 17 insertions, 4 deletions
diff --git a/libjava/gnu/gcj/runtime/FirstThread.java b/libjava/gnu/gcj/runtime/FirstThread.java index 21022250713..8cf477fad55 100644 --- a/libjava/gnu/gcj/runtime/FirstThread.java +++ b/libjava/gnu/gcj/runtime/FirstThread.java @@ -55,11 +55,15 @@ final class FirstThread extends Thread jarMainClassName = a.getValue(Attributes.Name.MAIN_CLASS); - } catch (Exception e) { - - System.err.println ("Failed to load Main-Class manifest attribute from\n" + args[0]); + if (jarMainClassName != null) + return; + } catch (Exception e) { + // empty } + + System.err.println ("Failed to load Main-Class manifest attribute from\n" + + args[0]); } // If interpreter is invoked with -jar, the main class name is recorded diff --git a/libjava/gnu/gcj/runtime/VMClassLoader.java b/libjava/gnu/gcj/runtime/VMClassLoader.java index ae0a0ebb20a..77051d253b7 100644 --- a/libjava/gnu/gcj/runtime/VMClassLoader.java +++ b/libjava/gnu/gcj/runtime/VMClassLoader.java @@ -34,7 +34,16 @@ final class VMClassLoader extends java.net.URLClassLoader try { if (e.endsWith(".jar") || e.endsWith (".zip")) - p.addElement(new URL("jar", "", -1, "file:///"+e+"!/")); + { + File archive = new File (e); + try { + p.addElement(new URL("jar", "", -1, "file://" + + archive.getCanonicalPath () + + "!/")); + } catch (IOException ex) { + // empty + } + } else if (e.endsWith ("/")) p.addElement (new URL("file", "", -1, e)); else if (new File (e).isDirectory ()) |