diff options
author | green <green@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-08-26 19:25:13 +0000 |
---|---|---|
committer | green <green@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-08-26 19:25:13 +0000 |
commit | ac96e9f0c156bca8ecfd01792509e39aa6f3b7ff (patch) | |
tree | ec60dfe7b11606b3c5c1d32bb2b29e9dd37d5be1 /libjava/prims.cc | |
parent | 69bb8d03035473dfec3a2c5d43738995a2b6c09e (diff) | |
download | gcc-ac96e9f0c156bca8ecfd01792509e39aa6f3b7ff.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@35999 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/prims.cc')
-rw-r--r-- | libjava/prims.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libjava/prims.cc b/libjava/prims.cc index 38714b300d9..7766f66cec7 100644 --- a/libjava/prims.cc +++ b/libjava/prims.cc @@ -47,6 +47,7 @@ details. */ #endif // DISABLE_GETENV_PROPERTIES #include <java/lang/Class.h> +#include <java/lang/ClassLoader.h> #include <java/lang/Runtime.h> #include <java/lang/String.h> #include <java/lang/Thread.h> @@ -906,6 +907,9 @@ _Jv_RunMain (const char *name, int argc, const char **argv, bool is_jar) if (is_jar) { + // name specifies a jar file. We must now extract the + // Main-Class attribute from the jar's manifest file. This is + // done by gnu.gcj.runtime.FirstThread.main. _Jv_Jar_Class_Path = strdup (name); arg_vec = JvConvertArgv (1, &_Jv_Jar_Class_Path); @@ -915,7 +919,14 @@ _Jv_RunMain (const char *name, int argc, const char **argv, bool is_jar) main_thread->start(); _Jv_ThreadWait (); + // FirstThread.main extracts the main class name and stores it + // here. class_name = gnu::gcj::runtime::FirstThread::jarMainClassName; + + // We need a new ClassLoader because the classpath must be the + // jar file only. The easiest way to do this is to lose our + // reference to the previous classloader. + java::lang::ClassLoader::system = NULL; } else class_name = JvNewStringLatin1 (name); |