Ant Classpath Problem (not tools.jar) [message #157195] |
Fri, 14 November 2003 19:09  |
Eclipse User |
|
|
|
Originally posted by: one61803.yahoo.com
Hi all,
I'm using Eclipse 3.0M3 and I have an interesting problem regarding Ant.
I'm building a project that resources an external JAR (courseware.jar) and
I've added it to the global ant runtime classpath using the
Window->Preferences->Ant->Runtime dialog. However, when I actually build
using Ant, the external JAR is only seen by javac and not javadoc or java.
In my build.xml, I have the following:
<path id="base_classpath">
<pathelement path="${java.class.path}"/>
</path>
<path id="default_classpath">
<path refid="base_classpath"/>
<pathelement path="classes/"/>
</path>
<javac
...
classpathref="default_classpath"
...>
<javadoc
...
classpathref="default_classpath"
...>
<java
...
classpathref="default_classpath"
...>
If I explicitly add a path to the JAR file using a pathelement then
everything is fine. If I remove the JAR file from the Ant global runtime
classpath then nothing works.
Does anyone have experience with this? Is this a possible bug?
Thanks,
Robert
|
|
|
Re: Ant Classpath Problem (not tools.jar) [message #157607 is a reply to message #157195] |
Sun, 16 November 2003 22:33  |
Eclipse User |
|
|
|
It is not a bug. It is the behavior of Ant.
The javac task includes the Ant runtime classpath by default
("includeAntRuntime" attribute). So you get the courseware.jar for free if
you have included it in the Ant runtime classpath preference.
Neither the javadoc task nor the java task do this so you need to include
the courseware.jar in the classpaths specified for these tasks.
I would recommend adding the JAR to the default_classpath and then
everything will always work.
HTH
Darins
"Robert" <one61803@yahoo.com> wrote in message
news:bp3qs0$5jt$1@eclipse.org...
> Hi all,
>
> I'm using Eclipse 3.0M3 and I have an interesting problem regarding Ant.
> I'm building a project that resources an external JAR (courseware.jar) and
> I've added it to the global ant runtime classpath using the
> Window->Preferences->Ant->Runtime dialog. However, when I actually build
> using Ant, the external JAR is only seen by javac and not javadoc or java.
> In my build.xml, I have the following:
>
> <path id="base_classpath">
> <pathelement path="${java.class.path}"/>
> </path>
>
> <path id="default_classpath">
> <path refid="base_classpath"/>
> <pathelement path="classes/"/>
> </path>
>
> <javac
> ...
> classpathref="default_classpath"
> ...>
>
> <javadoc
> ...
> classpathref="default_classpath"
> ...>
>
> <java
> ...
> classpathref="default_classpath"
> ...>
>
> If I explicitly add a path to the JAR file using a pathelement then
> everything is fine. If I remove the JAR file from the Ant global runtime
> classpath then nothing works.
>
> Does anyone have experience with this? Is this a possible bug?
>
> Thanks,
>
> Robert
>
|
|
|
Powered by
FUDForum. Page generated in 0.05082 seconds