ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <ste...@apache.org>
Subject Re: ant java jar="asdf.jar" fails to execute jar that java -jar asdf.jar succeeds on
Date Fri, 15 Aug 2008 15:40:25 GMT
Brendan Miller wrote:
> <target name="run" depends="publish">
>         <java jar="${files.publish.jar}"
>               fork="true"
>               />
>     </target>
> 
> Gives me:
> [java] Exception in thread "main" java.lang.NoClassDefFoundError:
> org/apache/log4j/Logger
> 
> but
> java -jar the_same_jar.jar
> works fine.
> 
> I specify the path to log4j.jar as Class-Path: log4j.jar in the manifest.
> 
> What could be happening here?
> 
> How is jar lookup different between java -jar and <java jar=.../> ?

run ant in -verbose mode and you should see what Ant execs for a fork. 
It may also be that the directory that is used as a base for the java 
program is different, so that path isnt being picked up


-- 
Steve Loughran                  http://www.1060.org/blogxter/publish/5
Author: Ant in Action           http://antbook.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message