Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ant install problem

 
hubert humptis
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when i try to run ant in the directory of the build.xml and Test.java 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:
PATH=$PATH:/home/toolshed/:$HOME/bin:/usr/java/j2sdk1.4.1_01/bin/:
export JAVA_HOME=/usr/java/j2sdk1.4.1_01/
export JIKESPATH=$PATH
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
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
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
------------------------
Vijay
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic