You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Antony Paul <an...@hotmail.com> on 2004/01/10 13:38:23 UTC

Need of including ant.jar in classpath for java task

Hi all,
    I am new to Ant. I have some questions.
1. Is it necessary to add ant.jar to classpath of java task to run a program
which uses one ant class. Why Ant by default do not include ant.jar and
other libraries in ANT_HOME\lib directory.
2. Is it possible to disable checking for duplicate classname by javac task.
I think this error is given by Ant.
    An off topic question too. Can any one suggest me a way to use Outlook
Express to get replies to this mail only. Where is an archive which provides
following by thread and good searching capability. I looked at  a site and
its searching capability is very poor.

rgds
Antony Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Need of including ant.jar in classpath for java task

Posted by Stefan Bodewig <bo...@apache.org>.
On Mon, 12 Jan 2004, Antony Paul <an...@hotmail.com> wrote:

> This means all the generated java servlet files will be in package
> org.apache.jsp and their physical locations do not follow the
> package name.

Which causes many more problems as well.  Ant's timestamp checking
won't work for them, for example.

> If I compile these files using a javac task like this it will say
> duplicate class.

So you must not compile the classes from separate physical directories
at the same time.  Use one <javac> per directory instead.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Need of including ant.jar in classpath for java task

Posted by Antony Paul <an...@hotmail.com>.
I will give more information on what I am trying to do. I am changing
Tomcat's JspC.java file(Not Ant jspc task). My purpose is to use  Tomcat JSP
compiler(JspC.java)  to compile all jsp files to work directory then use
javac task to compile these in to classes. My observation found that when
Tomcat compiles jsp files all jsp files are put in the package
org.apache.jsp irrespective of whether it is in a subdirectory or not. These
generated java files are put in the same directory order as jsp files are
residing in the webapp context. Thus a jsp file in the directory
myhost\jsp\index.jsp will be put in a package named org.apache.jsp and put
in the directory jsp in Tomcat work directory. This means all the generated
java servlet files will be in package org.apache.jsp and their physical
locations do not follow the package name. If I compile these files using a
javac task like this it will say duplicate class. The core part of javac
task is given below
<javac fork="true" srcdir="${jspc.base}" destdir="${jspc.base}"
optimize="off" debug="on" failonerror="false">

Any help is appreciated.

Antony Paul

----- Original Message -----
From: "Antony Paul" <an...@hotmail.com>
To: "Ant Users List" <us...@ant.apache.org>
Sent: Monday, January 12, 2004 6:39 PM
Subject: Re: Need of including ant.jar in classpath for java task


> 2. Is it possible to disable checking for duplicate classname by
> > > javac task.  I think this error is given by Ant.
> >
> > I don't think it is Ant doing this.  Can you give us an example?
>
> If I run a DOS batch file which goes to each directory and compiles files
in
> each directory it is not complaining about duplicate class name.
Definitely
> it is in each directory a new process is compiling files. Is there any
such
> option available with Ant which says to create a new process for each
> directory and compile files.
>
> Antony Paul
> ----- Original Message -----
> From: "Stefan Bodewig" <bo...@apache.org>
> To: <us...@ant.apache.org>
> Sent: Monday, January 12, 2004 4:12 PM
> Subject: Re: Need of including ant.jar in classpath for java task
>
>
> > On Sat, 10 Jan 2004, Antony Paul <an...@hotmail.com> wrote:
> >
> >
> > > Why Ant by default do not include ant.jar and other libraries in
> > > ANT_HOME\lib directory.
> >
> > So you can include your own version of DOM classes for example
> > (without having Ant interfere).
> >
> > You can use <presetdef> if you think the default behavior is wrong.
> >
> > > 2. Is it possible to disable checking for duplicate classname by
> > > javac task.  I think this error is given by Ant.
> >
> > I don't think it is Ant doing this.  Can you give us an example?
> >
> > > Where is an archive which provides following by thread and good
> > > searching capability.
> >
> > I use MARC <http://marc.theaimsgroup.com/?l=ant-user&r=1&w=2>, there
> > may be others.
> >
> > Stefan
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Need of including ant.jar in classpath for java task

Posted by Antony Paul <an...@hotmail.com>.
2. Is it possible to disable checking for duplicate classname by
> > javac task.  I think this error is given by Ant.
>
> I don't think it is Ant doing this.  Can you give us an example?

If I run a DOS batch file which goes to each directory and compiles files in
each directory it is not complaining about duplicate class name. Definitely
it is in each directory a new process is compiling files. Is there any such
option available with Ant which says to create a new process for each
directory and compile files.

Antony Paul
----- Original Message -----
From: "Stefan Bodewig" <bo...@apache.org>
To: <us...@ant.apache.org>
Sent: Monday, January 12, 2004 4:12 PM
Subject: Re: Need of including ant.jar in classpath for java task


> On Sat, 10 Jan 2004, Antony Paul <an...@hotmail.com> wrote:
>
>
> > Why Ant by default do not include ant.jar and other libraries in
> > ANT_HOME\lib directory.
>
> So you can include your own version of DOM classes for example
> (without having Ant interfere).
>
> You can use <presetdef> if you think the default behavior is wrong.
>
> > 2. Is it possible to disable checking for duplicate classname by
> > javac task.  I think this error is given by Ant.
>
> I don't think it is Ant doing this.  Can you give us an example?
>
> > Where is an archive which provides following by thread and good
> > searching capability.
>
> I use MARC <http://marc.theaimsgroup.com/?l=ant-user&r=1&w=2>, there
> may be others.
>
> Stefan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Need of including ant.jar in classpath for java task

Posted by Stefan Bodewig <bo...@apache.org>.
On Sat, 10 Jan 2004, Antony Paul <an...@hotmail.com> wrote:


> Why Ant by default do not include ant.jar and other libraries in
> ANT_HOME\lib directory.

So you can include your own version of DOM classes for example
(without having Ant interfere).

You can use <presetdef> if you think the default behavior is wrong.

> 2. Is it possible to disable checking for duplicate classname by
> javac task.  I think this error is given by Ant.

I don't think it is Ant doing this.  Can you give us an example?

> Where is an archive which provides following by thread and good
> searching capability.

I use MARC <http://marc.theaimsgroup.com/?l=ant-user&r=1&w=2>, there
may be others.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org