This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch: RFA for 4.0: use system class loader


Hi,

On Thu, 2005-04-14 at 15:37 -0700, Per Bothner wrote:
> Doing a
>    CLASSPATH=. make classes2.class
> works.  The classloader is:
> gnu.gcj.runtime.SystemClassLoader{urls=[], 
> parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
> 
> Shouldn't "." be in the default CLASSPATH, if not specified?

Yes. The order is -jar overrides -classpath overrides -Djava.class.path
overrides CLASSPATH environment overrides default value ".".

In your Makefile you set CLASSPATH to the empty string and we dutifully
use an empty class path in the system classloader.

With the following patch in place make check in kawa testsuites seems to
pass all tests.

2005-04-15  Mark Wielaard  <mark@klomp.org>

        * java/lang/natRuntime.cc (insertSystemProperties): Set
        java.class.path to "." if CLASSPATH not given or empty.

Do you think we should handle the case were CLASSPATH is set to the
empty string in this way?

Cheers,

Mark

diff -u -r1.47.2.6 natRuntime.cc
--- java/lang/natRuntime.cc     13 Apr 2005 21:36:55 -0000      1.47.2.6
+++ java/lang/natRuntime.cc     14 Apr 2005 23:16:35 -0000
@@ -624,8 +624,10 @@
   if (!path)
     {
       char *classpath = getenv("CLASSPATH");
-      if (classpath)
+      if (classpath && classpath[0] != 0)
        SET ("java.class.path", classpath);
+      else
+       SET ("java.class.path", ".");
     }
 }

Attachment: signature.asc
Description: This is a digitally signed message part


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]