Win a copy of Spring Boot in Practice this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

ant install problem

Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic