On 2008-11-25, Perry Trolard <[EMAIL PROTECTED]> wrote:
>> Is the classpath set up in the <java> Ant task? It should look
>> something like this:
>> Near the top:
>> <property name="build" location="classes"/>
>> In the compile clojure task:
>> <java classname="clojure.lang.Compile"
>> classpath="${build}:${cljsrc}">
>> <sysproperty key="clojure.compile.path" value="${build}"/>
>> <arg value="clojure.core"/>
>> ...and so on...
>> There have been so many patches on this, I'm not sure which one you
>> have.
>> -S
> Yes, that's the build.xml I have. If I add
> err.println(System.getProperty("java.class.path"));
You are running the <java> task inside the same VM as Ant itself, in
that case Ant loads the class via a different Classloader and the
classloader's classpath is not reflected by java.class.path - you will
always see the classpath Ant has been started with.
If you want to see the classloader that has loaded
clojure.lang.Compile you can do a getClass().getClassloader(). If
that is an instance of AntClassLoader, then it has a getClasspath()
method. If it is not, then clojure.lang.Compile has been available in
a classloader higher up in the chain which also probably means your
classpath is ignored.
If you add fork="true" to your <java> task then Clojure's compile will
be run in a separate VM and your classpath as specified to the task
will be visible as java.class.path sysproperty.
Stefan
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---