mirror of
https://github.com/gcc-mirror/gcc.git
synced 2026-05-06 23:25:24 +02:00
Sun Aug 20 21:02:48 2000 Anthony Green <green@redhat.com> * 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
74 lines
1.5 KiB
Java
74 lines
1.5 KiB
Java
// FirstThread.java - Implementation of very first thread.
|
|
|
|
/* Copyright (C) 1998, 1999 Free Software Foundation
|
|
|
|
This file is part of libgcj.
|
|
|
|
This software is copyrighted work licensed under the terms of the
|
|
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
|
|
details. */
|
|
|
|
package gnu.gcj.runtime;
|
|
|
|
import java.util.jar.*;
|
|
|
|
/**
|
|
* @author Tom Tromey <tromey@cygnus.com>
|
|
* @date August 24, 1998
|
|
*/
|
|
|
|
// This is entirely internal to our implementation.
|
|
|
|
final class FirstThread extends Thread
|
|
{
|
|
public native void run ();
|
|
|
|
public FirstThread (Class k, Object o)
|
|
{
|
|
super (null, null, "main");
|
|
klass = k;
|
|
klass_name = null;
|
|
args = o;
|
|
}
|
|
|
|
public FirstThread (String class_name, Object o)
|
|
{
|
|
super (null, null, "main");
|
|
klass = null;
|
|
klass_name = class_name;
|
|
args = o;
|
|
}
|
|
|
|
private static void die (String s)
|
|
{
|
|
System.err.println(s);
|
|
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;
|
|
private Object args;
|
|
}
|