You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by rebel indian <re...@yahoo.com> on 2003/06/24 10:29:55 UTC

Re: Detailed ANT BUILD ERROR

hi folks,
Now here is the sequence of steps i have followed:

1. downloaded apache-ant-1.6alpha/ in /usr/local

2. went to /usr/local and did a mkdir ant

3. set my ANT_HOME=/usr/local/ant

4. ./build.sh -Ddist.dir=/usr/local/ant dist

5. After this my ant directory looks like this when I
do ls:
bin/   etc/  lib/     LICENSE.dom  LICENSE.xerces 
welcome.html
docs/  KEYS  LICENSE  LICENSE.sax  README         
WHATSNEW

6. I went to /usr/local/ant/bin directory and ran
./ant
but the error is

[root@localhost bin]# ./ant
Buildfile: build.xml does not exist!
Build failed

-------------------------------------------------

After this I copied the build.xml file to the bin
directory i.e. to /usr/local/ant/bin 

[root@localhost ant]# cp
../apache-ant-1.6alpha/build.xml ./bin/

and then tried to ran ./ant again but got this error:

[root@localhost bin]# ./ant
Exception in thread "main"
java.lang.NoClassDefFoundError:
org/apache/tools/ant/Main
------------------------------------------------------
I HAVE 2 Questions:
1. Is the sequence of steps I am following is correct?
If its not correct, someone please tell me what the
exact sequence of steps I should follow, straight from
downloading and making directories, everything please
:-)

2. If I am doing correct steps, How to debug this
error? and how to run ant.

-----------------------------------------------------
Thanks a Lot
Rebel

--- peter reilly <pe...@corvil.com> wrote:
> This is a known problem which I think
> is fixed in the nightly build.
> 
> A workaround is to use
> 
> -Dchmod.fail=false
> 
> Peter
> 
> On Tue, 2003-06-24 at 07:36, Antoine Levy-Lambert
> wrote:
> > Hi,
> > It sounds like there is a problem with <chmod/> in
> this build. Maybe comment
> > out or remove the line which is causing the
> problem, then do the chmod that
> > the build.xml is attempting to do manually.  I
> have had the same problem
> > myself.
> > 
> > >file:/usr/local/apache-ant-1.5.3-1/build.xml:788:
> > > chmod returned: -1
> > >
> > Otherwise, if you are just trying to build your
> own copy of ant, you can
> > download a nightly image from
> http://cvs.apache.org/builds/ant/nightly
> > This small problem with <chmod/> is away there.
> > 
> > Another issue is :
> > 
> > - you should have an ant development and an ant
> installation directory and
> > keep them separate,
> > - for instance you could have as ANT_HOME
> /usr/local/ant distinct from your
> > development/build directory
> /usr/local/apache-ant-1.5.3-1
> > 
> > 
> > 
> > Cheers
> > 
> > Antoine
> > ----- Original Message -----
> > From: "rebel indian" <re...@yahoo.com>
> > To: <us...@ant.apache.org>
> > Sent: Tuesday, June 24, 2003 12:44 AM
> > Subject: ANT BUILD ERROR
> > 
> > 
> > > Hi folks:
> > > I downloaded .tar.gz archive:
> > > apache-ant-1.5.3-1-src.tar.gz [PGP] [MD5]
> > > as mentioned on web page Downloading Ant -
> Source
> > > Distribution on ant.apache.org
> > >
> > > After I did tar -zxvf apache....tar.gz
> > > I went to the directory of apache-ant....
> > >
> > > and  I wrote ./build.sh install to install the
> > > binaries in the current directory
> > > but what I get is BUILD FAILED. I am using
> > >
> > > [root@localhost apache-ant-1.5.3-1]# java
> -version
> > > java version "1.3.1_08"
> > > Java(TM) 2 Runtime Environment, Standard Edition
> > > (build 1.3.1_08-b03)
> > > Java HotSpot(TM) Client VM (build 1.3.1_08-b03,
> mixed
> > > mode)
> > >
> > > my PATHS:
> > >
>
---------------------------------------------------------
> > > my /etc/profile.d/java.sh file looks like this:
> > >
> > > JAVA_HOME=/usr/local/jdk1.3.1_08/
> > > export JAVA_HOME
> > > PATH=$PATH:$JAVA_HOME/bin
> > > export PATH
> > >
>
-------------------------------------------------------
> > > /etc/profile.d/ant.sh
> > >
> > > ANT_HOME=/usr/local/apache-ant-1.5.3-1/
> > > export ANT_HOME
> > > PATH=$PATH:$ANT_HOME/bin
> > > export PATH
> > >
>
------------------------------------------------------
> > >
> > >
> > > This is all what I get when I write build.sh:
> > >
>
------------------------------------------------------
> > >
> > >
> > > [root@localhost apache-ant-1.5.3-1]# ./build.sh
> > > install
> > > ... Bootstrapping Ant Distribution
> > > ... Compiling Ant Classes
> > > Note: Some input files use or override a
> deprecated
> > > API.
> > > Note: Recompile with -deprecation for details.
> > > ... Copying Required Files
> > > ... Building Ant Distribution
> > > Buildfile: build.xml
> > >
> > > bootstrap:
> > >
> > > prepare:
> > >
> > > check_for_optional_packages:
> > >
> > > build:
> > > Created dir:
> /usr/local/apache-ant-1.5.3-1/build/lib
> > > Compiling 162 source files to
> > > /usr/local/apache-ant-1.5.3-1/build/classes
> > > Note: Some input files use or override a
> deprecated
> > > API.
> > > Note: Recompile with -deprecation for details.
> > > Copying 1 file to
> > > /usr/local/apache-ant-1.5.3-1/build/classes
> > > Copying 2 files to
> > > /usr/local/apache-ant-1.5.3-1/build/classes
> > > Copying 2 files to
> > >
> >
>
/usr/local/apache-ant-1.5.3-1/build/classes/org/apache/tools/ant/taskdefs/op
> > tional/junit/xsl
> > >
> > > jars:
> > > Copying 4 files to
> /usr/local/apache-ant-1.5.3-1/build
> > > Building jar:
> > > /usr/local/apache-ant-1.5.3-1/build/lib/ant.jar
> > > Building jar:
> > >
> /usr/local/apache-ant-1.5.3-1/build/lib/optional.jar
> > >
> > > dist-lite:
> > > Created dir:
> /usr/local/apache-ant-1.5.3-1/bootstrap
> > > Created dir:
> > > /usr/local/apache-ant-1.5.3-1/bootstrap/bin
> > > Created dir:
> > > /usr/local/apache-ant-1.5.3-1/bootstrap/lib
> > > Copying 2 files to
> > > /usr/local/apache-ant-1.5.3-1/bootstrap/lib
> > > Copying 9 files to
> > > /usr/local/apache-ant-1.5.3-1/bootstrap/bin
> > >
> > > BUILD SUCCESSFUL
> > > Total time: 9 seconds
> > > ... Cleaning Up Build Directories
> > > ... Done Bootstrapping Ant Distribution
> > > Buildfile: build.xml
> > >
> > > install:
> > >
> > > prepare:
> > >
> > > check_for_optional_packages:
> > >
> > > build:
> > > Created dir:
> > > /usr/local/apache-ant-1.5.3-1/build/classes
> > > Compiling 444 source files to
> > > /usr/local/apache-ant-1.5.3-1/build/classes
> > > Note: Some input files use or override a
> deprecated
> > > API.
> > > Note: Recompile with -deprecation for details.
> > > Copying 3 files to
> > > /usr/local/apache-ant-1.5.3-1/build/classes
> > > Copying 2 files to
> > > /usr/local/apache-ant-1.5.3-1/build/classes
> > > Copying 2 files to
> > >
> >
>
/usr/local/apache-ant-1.5.3-1/build/classes/org/apache/tools/ant/taskdefs/op
> > tional/junit/xsl
> > >
> > > jars:
> > > Building jar:
> > > /usr/local/apache-ant-1.5.3-1/build/lib/ant.jar
> > > Building jar:
> > >
> /usr/local/apache-ant-1.5.3-1/build/lib/optional.jar
> > >
> > > dist-lite:
> > > Created dir: /usr/local/apache-ant-1.5.3-1/bin
> > > Copying 2 files to
> /usr/local/apache-ant-1.5.3-1/lib
> > > Copying 9 files to
> /usr/local/apache-ant-1.5.3-1/bin
> > >
> > > BUILD FAILED
> > >
> file:/usr/local/apache-ant-1.5.3-1/build.xml:788:
> > > chmod returned: -1
> > >
> > > Total time: 16 seconds
> > >
> > >
>
------------------------------------------------------
> > >
> > > PLEASE HELP
> > > Thanks and Regards
> > >
> > > __________________________________
> > > Do you Yahoo!?
> > > SBC Yahoo! DSL - Now only $29.95 per month!
> > > http://sbc.yahoo.com
> > >
> > >
>
---------------------------------------------------------------------
> > > 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
> 


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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


Re: Detailed ANT BUILD ERROR

Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
On Tue, 24 Jun 2003 06:29 pm, rebel indian wrote:
>
> 6. I went to /usr/local/ant/bin directory and ran
> ./ant
> but the error is
>
> [root@localhost bin]# ./ant
> Buildfile: build.xml does not exist!
> Build failed
>

That is to be expected. You are running Ant but there is no build file telling 
Ant what to do. It's a bit like changing to javac's home directory and typing 
javac. It's not going to find any java source files to process either.

So, in some location (/tmp maybe), create a simple "hello world" build file

<project name="test" default="main">
  <target name="main">
    <echo message="Hello, World!"/>
  </target>
</project>

Now type
/usr/local/ant/bin/ant

and see what you get. If that works, you should setup your PATH and ANT_HOME 
environment variables and export them in your startup script.

> -------------------------------------------------
>
> After this I copied the build.xml file to the bin
> directory i.e. to /usr/local/ant/bin
>
> [root@localhost ant]# cp
> ../apache-ant-1.6alpha/build.xml ./bin/

This will not be useful. The build.xml file is supposed to go with the source 
tree with which it is associated. You can't generally move it around and 
expect it to work.

>
> and then tried to ran ./ant again but got this error:
>
> [root@localhost bin]# ./ant
> Exception in thread "main"
> java.lang.NoClassDefFoundError:
> org/apache/tools/ant/Main

Now that is odd, since it ran OK in step 6 above and gave an appropriate 
error. Not sure what is going on here.

Have you read the pages here:
http://ant.apache.org/manual/installlist.html

Conor



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