Meaningless Drivel is fun!
The moose likes Ant, Maven and Other Build Tools and the fly likes ant install problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "ant install problem" Watch "ant install problem" New topic

ant install problem

hubert humptis

Joined: May 10, 2002
Posts: 9
when i try to run ant in the directory of the build.xml and file i get this error:
$ ant -v
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/tools/ant/Main

I think it is classpath issue and here is my variables in bash:
export JAVA_HOME=/usr/java/j2sdk1.4.1_01/
export CLASSPATH=~/packages:$JAVA_HOME/lib/tools.jar:/usr/local/ant/build/lib/:
export ANT_HOME=/usr/local/ant
export PATH=${PATH}:${ANT_HOME}/bin

if anyone has an idea...
[ January 23, 2003: Message edited by: hubert humptis ]
Vijayakumar Arya
Ranch Hand

Joined: Jan 27, 2003
Posts: 76
ant.jar is located in ANT_HOME/lib and this path is not available in the classpath variable. Here the classpath is referring to ANT_HOME/build/lib.
You need to specify only the path to locate the ant bin directory and the classpath for running ant will be done using the script.
Refer to Installing ant section in the Ant documentation and follow the instructions for installing the ant.
Unix (bash)
Assume Ant is installed in /usr/local/ant. The following sets up the environment:
export ANT_HOME=/usr/local/ant
export JAVA_HOME=/usr/local/jdk-1.2.2
export PATH=${PATH}:${ANT_HOME}/bin
Unix (csh)
setenv ANT_HOME /usr/local/ant
setenv JAVA_HOME /usr/local/jdk-1.2.2
set path=( $path $ANT_HOME/bin )
Taken from the documentation

Thanks,<p>Vijay<p>The Hand that gives, Gathers.
I agree. Here's the link:
subject: ant install problem
It's not a secret anymore!