Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #24563

Re: Exception in thread “main” java.lang.NoClassDefFoundError Caused by: java.lang.ClassNotFoundException: org.apache.tools.ant.Task

Newsgroups comp.lang.java.programmer
Date 2013-07-01 17:25 -0700
References <1c9087e2-3652-4d73-8ef8-f5d3e8c4445f@googlegroups.com> <kqs8u8$v02$1@dont-email.me>
Message-ID <6cbfd66f-c76f-47a0-a9e3-a4924a6d3a4a@googlegroups.com> (permalink)
Subject Re: Exception in thread “main” java.lang.NoClassDefFoundError Caused by: java.lang.ClassNotFoundException: org.apache.tools.ant.Task
From Lew <lewbloch@gmail.com>

Show all headers | View raw


markspace wrote:
> morpheous.sigma@gmail.com wrote:
>> export CLASSPATH=$CLASSPATH:/usr/local/apache-ant-1.9.1/etc:/usr/local/apache-ant-1.9.1/lib
> 
> This is probably your mistake here.  Despite the similar names, 
> CLASSPATH does not work like the PATH environment variables in Unix. 

All of which is thoroughly explained in the online Java documentation.

> You have to set the classpath to the actual name of the Jar file you 
> want to use, or use a '*' as the final element of the class path to use 
> all Jar files in a directory.  Doing neither of those, like you have, 
> actually looks for 'lose' .class files in the file hierarchy.

Did you mean "'loose'"?

> export 
> CLASSPATH=$CLASSPATH:/usr/local/apache-ant-1.9.1/etc/*:/usr/local/apache-ant-1.9.1/lib/*
> 
> or
> 
> export 
> CLASSPATH=$CLASSPATH:/usr/local/apache-ant-1.9.1/etc/some-ant.jar:/usr/local/apache-ant-1.9.1/lib/another.jar

OP, do read the documentation as this will give you the full story.

-- 
Lew

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Exception in thread “main” java.lang.NoClassDefFoundError Caused by: java.lang.ClassNotFoundException: org.apache.tools.ant.Task morpheous.sigma@gmail.com - 2013-07-01 00:14 -0700
  Re: Exception in thread “main” java.lang.NoClassDefFoundError Caused by: java.lang.ClassNotFoundException: org.apache.tools.ant.Task lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-07-01 09:36 +0100
  Re: Exception in thread “main” java.lang.NoClassDefFoundError Caused by: java.lang.ClassNotFoundException: org.apache.tools.ant.Task markspace <markspace@nospam.nospam> - 2013-07-01 09:03 -0700
    Re: Exception in thread “main” java.lang.NoClassDefFoundError Caused by: java.lang.ClassNotFoundException: org.apache.tools.ant.Task Lew <lewbloch@gmail.com> - 2013-07-01 17:25 -0700

csiph-web