aboutsummaryrefslogtreecommitdiff
path: root/libjava/gnu
diff options
context:
space:
mode:
authorAnthony Green <green@redhat.com>2000-08-26 19:25:13 +0000
committerAnthony Green <green@gcc.gnu.org>2000-08-26 19:25:13 +0000
commit6aaeb97551dcfaa5dbcca802782ec42dd7b4cf43 (patch)
treeec60dfe7b11606b3c5c1d32bb2b29e9dd37d5be1 /libjava/gnu
parent14fdf4b67e8843c870c88baac0c4974b2e67bb32 (diff)
downloadgcc-6aaeb97551dcfaa5dbcca802782ec42dd7b4cf43.zip
gcc-6aaeb97551dcfaa5dbcca802782ec42dd7b4cf43.tar.gz
gcc-6aaeb97551dcfaa5dbcca802782ec42dd7b4cf43.tar.bz2
Makefile.in: Rebuilt.
2000-08-26 Anthony Green <green@redhat.com> * Makefile.in: Rebuilt. * Makefile.am (java/lang/ClassLoader.h): Make _Jv_RunMain a friend. * prims.cc: Include ClassLoader.h. (_Jv_RunMain): When executing jar files, classpath must be the jar file only. Lose our reference to the system ClassLoader in order to get a new one with the correct classpath. * java/lang/natSystem.cc (init_properties): When executing a jar file, only use the jar file for java.class.path. * gnu/gcj/runtime/VMClassLoader.java: Use the canonical file name for bytecode archives. * gnu/gcj/runtime/FirstThread.java: Handle case where manifest exists, but not Main-Class. From-SVN: r35999
Diffstat (limited to 'libjava/gnu')
-rw-r--r--libjava/gnu/gcj/runtime/FirstThread.java10
-rw-r--r--libjava/gnu/gcj/runtime/VMClassLoader.java11
2 files changed, 17 insertions, 4 deletions
diff --git a/libjava/gnu/gcj/runtime/FirstThread.java b/libjava/gnu/gcj/runtime/FirstThread.java
index 2102225..8cf477f 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 ae0a0eb..77051d2 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 ())