Exception in thread "main" java.lang.NoClassDefFoundError: org / joda / time / ReadableInstant

I built an executable jar using ant script, the only external jar I used was joda-time 2.0. The ant build script construct seemed to work, since I did not get any compilation errors, and if I were to remove jode-time 2.0.jar from the lib directory, the build would really complete as expected. Anyway, after creating the flag, I get this error when I try to run:

java -jar myapp.jar

Exception in thread "main" java.lang.NoClassDefFoundError: org / joda / time / ReadableInstant

Any thoughts on this? I'm just not sure where to look, everything works fine in Eclipse. thanks for any ideas

+5
source share
2 answers

, , Java, joda-time jar . classpath java -jar. Ant , , , , .

java -cp myapp.jar:joda-time-2.0.jar com.foo.YourMainClass
+9

- JarJar, JAR JAR. , JVM JAR, , JAR, JAR.

+2

All Articles