You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Robert Krueger <kr...@signal7.de> on 2000/09/18 15:24:00 UTC

jikes and extdirs problem

hi,

are there known issues with ant and jikes with respect to the use of 
extdirs? I have a buildfile that works with javac but doesn't with jikes. 
it seems to be related to requiring the libraries in a certain order. I 
noticed that ant puts jaxp.jar in the classpath upon compilation (btw why 
is that). with jikes it puts those in front of the libraries I specified 
via extdirs which results in compile errors because I rely on DOM level 2 
in xerces.

AFAIK the libraries specified in the extdirs should come first (and do with 
javac). is this a known bug? is there a workaround for this?

TIA,

robert


(-) Robert Krüger
(-) SIGNAL 7 Gesellschaft für Informationstechnologie mbH
(-) Brüder-Knauß-Str. 79 - 64285 Darmstadt,
(-) Tel: 06151 665401, Fax: 06151 665373
(-) krueger@signal7.de, www.signal7.de


Re: jikes and extdirs problem

Posted by Robert Krueger <kr...@signal7.de>.
At 16:20 18.09.00 , you wrote:
>I don't think so - AFAIK jikes doesn't support the "-extdirs" option.

that's correct but ant is smart enough to know that and instead puts the 
jars and zips form the extdirs into the classpath. all I'm saying is that 
it doesn't do it correctly (see previous posting). compiling with jikes and 
javac leads to different results, which shouldn't be happening (except for 
the speed difference ;-).

robert


(-) Robert Krüger
(-) SIGNAL 7 Gesellschaft für Informationstechnologie mbH
(-) Brüder-Knauß-Str. 79 - 64285 Darmstadt,
(-) Tel: 06151 665401, Fax: 06151 665373
(-) krueger@signal7.de, www.signal7.de


Re: jikes and extdirs problem

Posted by Robert Krueger <kr...@signal7.de>.
At 14:43 18.09.00 , you wrote:
>Try something like
>
>         <javac
>                         srcdir="src"
>                         destdir="${dest.classes}"
>                         debug="on"
>                         deprecation="on">
>             <classpath>
>               <pathelement path="${classpath}" />
>               <fileset dir="lib">
>                 <include name="**/*.jar" />
>               </fileset>
>             </classpath>
>         </javac>

thanks a lot. so do I interprete this correctly that is IS a known bug and 
what you're proposing is a workaround that basically does what ant should 
be doing?

regards,

robert
(-) Robert Krüger
(-) SIGNAL 7 Gesellschaft für Informationstechnologie mbH
(-) Brüder-Knauß-Str. 79 - 64285 Darmstadt,
(-) Tel: 06151 665401, Fax: 06151 665373
(-) krueger@signal7.de, www.signal7.de


jikes and extdirs problem

Posted by Jochen Strunk <st...@signal7.de>.
Hi,

the CVS version of addExtdirsToClasspath in the javac task does not seem to 
work at all.

The following fixed it for me, probably not very nice though:

--- Javac.java~ Mon Sep 18 07:41:17 2000
+++ Javac.java  Tue Sep 19 10:59:39 2000
@@ -749,7 +749,7 @@
              File dir = project.resolveFile(dirs[i]);
              FileSet fs = new FileSet();
              fs.setDir(dir);
-            fs.setIncludes(dirs[i]+"*");
+            fs.setIncludes("*.jar *.zip");
              classpath.addFileset(fs);
          }
      } 



Best regards,
jochen



(-) Jochen Strunk
(-) SIGNAL 7 Gesellschaft für Informationstechnologie mbH
(-) Brüder-Knauß-Str. 79 - 64285 Darmstadt,
(-) Tel: 06151 665402, Fax: 06151 665373
(-) strunk@signal7.de, www.signal7.de


Re: jikes and extdirs problem

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "RK" == Robert Krueger <kr...@signal7.de> writes:

 RK> At 17:04 18.09.00 , you wrote:

 >> I don't know where command line javac puts the extdirs, your
 >> observation indicates it comes between bootclasspath and the
 >> classpath specified on the command line.

 RK> yes it does.

OK, checked the tool docs myself. Fixed the order for jikes and jvc in
CVS.

Stefan

Re: jikes and extdirs problem

Posted by Robert Krueger <kr...@signal7.de>.
At 17:04 18.09.00 , you wrote:
> >>>>> "RK" == Robert Krueger <kr...@signal7.de> writes:
>
>  RK> AFAIK the libraries specified in the extdirs should come first
>  RK> (and do with javac). is this a known bug? is there a workaround
>  RK> for this?
>
>Well, I'm not actually sure. What would be the right thing? Ant uses
>the following order:
>
>* bootclasspath only if using jikes/jvc.
>
>* destdir
>
>* classpath specified for this task (either via attribute or nested
>element).
>
>* System classpath, i.e. the CLASSPATH this Ant instance has been
>invoked with.
>
>* Runtime classes classes.zip or rt.jar only if using jikes/jvc.
>
>* extdirs only if using jikes/jvc.
>
>* sourcedir unless using javac in >= JDK 1.2
>
>* the content of the environment variable JIKESPATH if using jikes.
>
>I don't know where command line javac puts the extdirs, your
>observation indicates it comes between bootclasspath and the classpath
>specified on the command line.

yes it does. I just doublechecked. when jikes is used it appends the jars 
and zips from the extdirs to the classpath instead of prepending them, 
which leads to a different behaviour between javac and jikes.

>What is the order one would expect?

if javac is the reference implementation IMHO the order of the constructed 
jikes classpath should be different than it is now.

robert


>Stefan



(-) Robert Krüger
(-) SIGNAL 7 Gesellschaft für Informationstechnologie mbH
(-) Brüder-Knauß-Str. 79 - 64285 Darmstadt,
(-) Tel: 06151 665401, Fax: 06151 665373
(-) krueger@signal7.de, www.signal7.de


Re: jikes and extdirs problem

Posted by Robert Krueger <kr...@signal7.de>.
-snip

>What is the order one would expect?

I just checked the jdk tool docs again. It is like I said. Extension 
classes are to be found before user classes specified in the classpath 
(bootstrap, extension, user). So the way ant simulates that with jikes is 
simply wrong.

robert

>Stefan

(-) Robert Krüger
(-) SIGNAL 7 Gesellschaft für Informationstechnologie mbH
(-) Brüder-Knauß-Str. 79 - 64285 Darmstadt,
(-) Tel: 06151 665401, Fax: 06151 665373
(-) krueger@signal7.de, www.signal7.de


Re: jikes and extdirs problem

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "RK" == Robert Krueger <kr...@signal7.de> writes:

 RK> AFAIK the libraries specified in the extdirs should come first
 RK> (and do with javac). is this a known bug? is there a workaround
 RK> for this?

Well, I'm not actually sure. What would be the right thing? Ant uses
the following order:

* bootclasspath only if using jikes/jvc.

* destdir

* classpath specified for this task (either via attribute or nested
element).

* System classpath, i.e. the CLASSPATH this Ant instance has been
invoked with.

* Runtime classes classes.zip or rt.jar only if using jikes/jvc.

* extdirs only if using jikes/jvc.

* sourcedir unless using javac in >= JDK 1.2

* the content of the environment variable JIKESPATH if using jikes.

I don't know where command line javac puts the extdirs, your
observation indicates it comes between bootclasspath and the classpath
specified on the command line.

What is the order one would expect?

Stefan

Re: jikes and extdirs problem

Posted by Fergus Gallagher <Fe...@OrbisUK.com>.
I don't think so - AFAIK jikes doesn't support the "-extdirs" option.

At 16:07 18/09/00 +0200, you wrote:
>At 14:43 18.09.00 , you wrote:
>>Try something like
>>
>>         <javac
>>                         srcdir="src"
>>                         destdir="${dest.classes}"
>>                         debug="on"
>>                         deprecation="on">
>>             <classpath>
>>               <pathelement path="${classpath}" />
>>               <fileset dir="lib">
>>                 <include name="**/*.jar" />
>>               </fileset>
>>             </classpath>
>>         </javac>
>
>thanks a lot. so do I interprete this correctly that is IS a known bug and 
>what you're proposing is a workaround that basically does what ant should 
>be doing?
>
>regards,
>
>robert
>(-) Robert Krüger
>(-) SIGNAL 7 Gesellschaft für Informationstechnologie mbH
>(-) Brüder-Knauß-Str. 79 - 64285 Darmstadt,
>(-) Tel: 06151 665401, Fax: 06151 665373
>(-) krueger@signal7.de, www.signal7.de

-- 
Fergus Gallagher
Orbis
http://www.orbisuk.com/
+44-(0)20-8987 0717