diff options
Diffstat (limited to 'libjava/gnu/gcj/runtime/FirstThread.java')
-rw-r--r-- | libjava/gnu/gcj/runtime/FirstThread.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/libjava/gnu/gcj/runtime/FirstThread.java b/libjava/gnu/gcj/runtime/FirstThread.java index c7f521c5fc9..21022250713 100644 --- a/libjava/gnu/gcj/runtime/FirstThread.java +++ b/libjava/gnu/gcj/runtime/FirstThread.java @@ -10,6 +10,8 @@ details. */ package gnu.gcj.runtime; +import java.util.jar.*; + /** * @author Tom Tromey <tromey@cygnus.com> * @date August 24, 1998 @@ -43,6 +45,27 @@ final class FirstThread extends Thread System.exit(1); } + public static void main (String[] args) + { + try { + + JarFile j = new JarFile (args[0]); + + Attributes a = j.getManifest().getMainAttributes(); + + 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 interpreter is invoked with -jar, the main class name is recorded + // here. + public static String jarMainClassName; + // Private data. private Class klass; private String klass_name; |