user1314836
user1314836

Reputation: 239

ant command works from within Eclipse but not from linux command line

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.

Upvotes: 2

Views: 728

Answers (1)

user1314836
user1314836

Reputation: 239

Thank you Jason Braucht for your help, the problem was that EventReservationCore/lib/* was not working, even if I had read that it should work on Linux.

Upvotes: 1

Related Questions