This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
org.apache.commons.lang.ObjectUtils package comes from Jakarta Commons Lang. This source is in src directory and Commons Lang jar is in lib directory. My buildfile is in root directory and it is:
build and jar target run OK. But when I run runjava target I get this message:
Buildfile: C:\java\eclipse\workspace\testant\build.xml init: build: runjava: [java] java.lang.NoClassDefFoundError: Teste [java] Exception in thread "main" [java] Java Result: 1 BUILD SUCCESSFUL Total time: 1 second
And runjar target prints this:
Buildfile: C:\java\eclipse\workspace\testant\build.xml init: build: jar: runjar: [java] java.lang.NoClassDefFoundError: org/apache/commons/lang/ObjectUtils [java] at Teste.main(Unknown Source) [java] Exception in thread "main" [java] Java Result: 1 BUILD SUCCESSFUL Total time: 1 second
But if I remove reference to ObjectUtils method:
runjar target runs correctly, but runjava target shows same message. I it was problem of classpath configuration, I had problems with build target. So my mistake must be in other place, but I know where.
=================================<br /> Rafael U. C. Afonso<br /> <a href="http://www.javafree.com.br" target="_blank" rel="nofollow">www.javafree.com.br</a><br />=================================<br /><i>Where is debug?<br />debug is on the table</i>
Use nested <fileset> Define a path under <project> level, it can be used multi-times
Joined: Oct 10, 2000
Originally posted by Rafael Afonso: Hello:
But now I have a new doubt. If I had more than a jar file in my classpath. Would I include these files one by one in "Class-Path" attibute?
Yes, you would need to include each jar. To include multiple jar files in the jar's manifest Class-Path, they should be all on one line separated by a space. FYI, this is a lot easier using ant than doing it on the command-line!