I have a bunch of .java files in the "src" folder, which depends on the three jars in the "lib" folder. I have the following build.xml file:
<?xml version="1.0"?>
<project name="MyProj" basedir=".">
<property name="src" value="src"/>
<property name="build" value="build"/>
<property name="lib" value="lib"/>
<path id="master-classpath">
<fileset dir="${lib}">
<include name="activemq-all-5.1-SNAPSHOT.jar"/>
<include name="geronimo-jms_1.1_spec-1.1.1.jar"/>
<include name="activemq-core-5.3.0.jar"/>
</fileset>
</path>
<javac destdir="${build}">
<src path="${src}"/>
<classpath refid="master-classpath"/>
</javac>
</project>
This compiles fine, but when I try to run, I get
"java.lang.NoClassDefFoundError: javax / JMS / Destination"
This program starts and compiles fine when I include banks in the build path using Eclipse.
EDIT: So I copied the banks to a folder in which there are compiled classes. The class with the main method is NDriver.class. When I try:
java -classpath. / geronimo -jms_1.1_spec-1.1.1.jar: ./ activemq-core-5.3.0.jar: ./ activemq-all-5.1-SNAPSHOT.jar NDriver
This gives:
Exception in thread "main" java.lang.NoClassDefFoundError: NDriver
.