jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Lenz <cml...@gmx.de>
Subject Re: "You must either set location or path on <pathelement>" Exception Message
Date Fri, 28 Nov 2003 15:19:08 GMT
Vincent Massol wrote:
> Hi Simon,
> 
> Here's the code used by the <cactus> task to find the tools.jar file:
> 
>     protected final File getToolsJar()
>         throws FileNotFoundException
>     {
>         String javaHome = System.getProperty("java.home"); 
>         // TODO: Fix this as it fails on Max OSX (which doesn't have a 
>         // tools.jar file).
>         File toolsJar = new File(javaHome + "/../lib/tools.jar");
>         if (!toolsJar.isFile())
>         {
>             throw new FileNotFoundException(toolsJar.getAbsolutePath());
>         }
>         return toolsJar;
>     }   
> 
> So it means it cannot find it in [javahome]/../lib/tools.jar
> 
> Do you know where it is for you (i.e. what directory)?

Hmm, does this mean that this works for you in Eclipse?

Obviously this code is quite broken, and was just one of those quick and 
dirty hacks none of us ever produces ourselves ;-) I think that tools.jar 
(or whatever classpath entry contains the Java compiler) should normally 
always be on the Ant classpath. So some type of lookup to find the resource 
that contains the compiler should do the trick. I'll need to look into the 
<javac> etc, to see how the Ant folks get the compiler on the classpath of a 
forked VM.

-chris



Mime
View raw message