2

I have a Java project done with Eclipse and I have an ANT command that works perfectly if run from within Eclipse's ANT tool but it doesn't work if I try to run the ANT command from the Linux command line.

Why can it be happening? I have several ANT commands working both in Eclipse and from the command line.

The command is this one:

<target name="run.jmsserver">
            <java classname="JMSInternationalEventServer/JMSInternationalEventServer" classpath="${classpath}" fork="true">
            </java>
</target>

And classpath is defined previously:

<property name="classpath" location="bin:EventReservationCore/bin:EventReservationCore/db:EventReservationCore/lib/*:EventReservationCore/lib/util_iso2.jar:EventReservationCore/lib/sqlitejdbc-v056.jar:AuthorizationRMI/lib/AuthorizationService.jar"/>

The error I am getting is:

 [java] Exception in thread "main" java.lang.NoClassDefFoundError: javax/jms/JMSException
 [java] Caused by: java.lang.ClassNotFoundException: javax.jms.JMSException
 [java]     at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
 [java]     at java.security.AccessController.doPrivileged(Native Method)
 [java]     at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
 [java]     at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
 [java]     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
 [java]     at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
 [java] Could not find the main class: JMSInternationalEventServer.JMSInternationalEventServer.  Program will exit.
 [java] Java Result: 1

Thank you very much.

4

1 回答 1

1

谢谢 Jason Braucht 的帮助,问题是它EventReservationCore/lib/*不起作用,即使我读过它应该在 Linux 上工作。

于 2012-04-27T10:29:19.260 回答