4

当我进入lein repl我的项目根文件夹时,我收到错误消息。我试图删除主文件夹中的 .lein 目录并重新下载 lein,但它对我不起作用。

可能重复: 使用 leiningen 时出现 ExceptionInInitializerError

Exception in thread "Thread-1" java.util.zip.ZipException: zip file is empty
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:214)
at java.util.zip.ZipFile.<init>(ZipFile.java:144)
at java.util.jar.JarFile.<init>(JarFile.java:153)
at java.util.jar.JarFile.<init>(JarFile.java:117)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at clojure.lang.Reflector.invokeConstructor(Reflector.java:180)
at leiningen.core.classpath$extract_native_deps.invoke(classpath.clj:43)
at clojure.lang.AFn.applyToHelper(AFn.java:167)
at clojure.lang.AFn.applyTo(AFn.java:151)
at clojure.core$apply.invoke(core.clj:617)
at leiningen.core.classpath$when_stale.doInvoke(classpath.clj:66)
at clojure.lang.RestFn.invoke(RestFn.java:580)
at leiningen.core.classpath$resolve_dependencies.doInvoke(classpath.clj:231)
at clojure.lang.RestFn.invoke(RestFn.java:425)
at leiningen.core.eval$prep.invoke(eval.clj:54)
at leiningen.core.eval$eval_in_project.invoke(eval.clj:282)
at leiningen.repl$start_server.invoke(repl.clj:117)
at leiningen.repl$server$fn__6110.invoke(repl.clj:173)
at clojure.lang.AFn.applyToHelper(AFn.java:159)
at clojure.lang.AFn.applyTo(AFn.java:151)
at clojure.core$apply.invoke(core.clj:617)
at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1788)
at clojure.lang.RestFn.invoke(RestFn.java:425)
at clojure.lang.AFn.applyToHelper(AFn.java:163)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at clojure.core$apply.invoke(core.clj:621)
at clojure.core$bound_fn_STAR_$fn__4102.doInvoke(core.clj:1810)
at clojure.lang.RestFn.invoke(RestFn.java:397)
at clojure.lang.AFn.run(AFn.java:24)
at java.lang.Thread.run(Thread.java:722)

编辑:我在 ubuntu 12.10 64 位机器上运行 leiningen 2.1.2。

注意:如果我lein repl在我的项目根文件夹之外运行,那很好。

4

3 回答 3

5

我曾经通过运行使用 lein2 成功地解决了这个问题

lein clean

我的下一个猜测是将您的 ~/.m2/repository 移开并重试。

于 2013-03-29T18:12:27.930 回答
1

this is because you can't name your uberjar the same as the jar file named internally by leiningen. just make sure you add something like "name-0.1.0-STABLE" or anything else like SNAPSHOT or LATEST to your :uberjar ... :uberjar-name.

于 2019-05-29T12:15:56.837 回答
0

没有什么对我有用(清洁,吹走〜/ .m2)。我什至去了另一台机器。然后我想可能lein对同时看到这两个条目感到困惑:

:jar-name "my-server.jar"
:uberjar-name "my-server.jar"

So I commented out :uberjar-name and ran lein jar and it didn't give me the exception - ran through to the end.

于 2016-03-04T12:43:19.793 回答