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

后端 未结 2 1028
北海茫月
北海茫月 2021-01-18 12:28

I built an executable jar using an ant script, the only external jar I used was joda-time 2.0. The ant build script \"seemed\" to work as I did not recieve any compile error

2条回答
  •  半阙折子戏
    2021-01-18 12:59

    Unless you're using a custom classloader or something like JarJar, then you cannot bundle external JARs inside your executable JAR. Your manifest file will need to list a classpath, but the JVM will look for the JARs you list in the same directory as your executable JAR, not inside your executable JAR.

提交回复
热议问题