From 1a558147d192b81f718a55056d2467221dfeb5de Mon Sep 17 00:00:00 2001 From: Anthony Green Date: Mon, 21 Aug 2000 06:05:20 +0000 Subject: natSystem.cc (init_properties): Change sourceware reference to sources.redhat.com. Sun Aug 20 21:02:48 2000 Anthony Green * java/lang/natSystem.cc (init_properties): Change sourceware reference to sources.redhat.com. * include/java-props.h: Add _Jv_Jar_Class_Path. * prims.cc: Ditto. Set it from `gij -jar file' option. * java/lang/natSystem.cc (init_properties): Set java.class.path from {gij -jar file}:{CLASSPATH variable}:{-Djava.class.path= or .} * java/util/PropertyPermission.java: Import from GNU Classpath. * Makefile.in: Rebuilt. * Makefile.am: Add java/util/PropertyPermission.java. * java/lang/System.java: Add setProperty method. * gij.cc (main): Add -jar option to execute jar files. (help): Describe -jar option. * prims.cc (_Jv_RunMain): Add support for jar execution mode. * gnu/gcj/tools/Gij.java: New file. * include/jvm.h: Add is_jar argument to _Jv_RunMain. * gnu/gcj/runtime/FirstThread.java (main): New method. * java/util/jar/Attributes.java: Correct comment spelling. From-SVN: r35829 --- libjava/gnu/gcj/runtime/FirstThread.java | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'libjava/gnu') diff --git a/libjava/gnu/gcj/runtime/FirstThread.java b/libjava/gnu/gcj/runtime/FirstThread.java index c7f521c..2102225 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 * @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; -- cgit v1.1