Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Ant Classpath Problem (not tools.jar)
Ant Classpath Problem (not tools.jar) [message #157195] Sat, 15 November 2003 00:09 Go to next message
Eclipse UserFriend
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] Mon, 17 November 2003 03:33 Go to previous message
Darin Swanson is currently offline Darin SwansonFriend
Messages: 2386
Registered: July 2009
Senior Member
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
>
Previous Topic:Ant 1.6 integration
Next Topic:Eclipse does not run from a CD-ROM
Goto Forum:
  


Current Time: Sat Apr 27 02:05:32 GMT 2024

Powered by FUDForum. Page generated in 0.02596 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top