[kaffe] kaffe -jar fails when environment variable CLASSPATH is set

Ito Kazumitsu ito.kazumitsu at hidec.co.jp
Tue Jun 7 01:36:41 PDT 2005


From: Michael Koch <konqueror at gmx.de>
Subject: Re: [kaffe] kaffe -jar fails when environment variable CLASSPATH is set
Date: Tue, 7 Jun 2005 07:16:55 +0200

> CLASSPATH and -classpath have to get completely ignored when using -jar.
> The only valid CLASSPATH is the Class-Path entry in the manifest of the jar.

Oh, yes.  j2sdk-1_4_2-doc/docs/tooldocs/linux/java.html says so.

Then the code in main.c

   752                          if (vmargs.classpath != NULL) {
   753                                  strcat (newcpath, path_separator);
   754                                  strcat (newcpath, vmargs.classpath);
   755                                  free (vmargs.classpath);
   756                          }
   757
   758                          /* set the new classpath */
   759                          vmargs.classpath = newcpath;

should be

   752                          if (vmargs.classpath != NULL) {
   755                                  free (vmargs.classpath);
   756                          }
   757
   758                          /* set the new classpath */
   759                          vmargs.classpath = newcpath;

Anyway, the problem is that "free (vmargs.classpath);" fails here
if the environment variable CLASSPATH is set.  However meaningless
it may be,  CLASSPATH can be set when -jar is used.

My patch is expected to save this case.




More information about the kaffe mailing list