ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Conor MacNeill <co...@cortexebusiness.com.au>
Subject Re: Detailed ANT BUILD ERROR
Date Tue, 24 Jun 2003 10:11:47 GMT
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


Mime
View raw message