使用 leiningen 时出现 ExceptionInInitializerError

发布于 2024-12-02 11:15:41 字数 3963 浏览 0 评论 0原文

我是一个刚开始使用 Clojure 和 Leiningen 的初学者,在尝试使用各种 lein 命令时遇到了问题。虽然 $ lein deps 工作正常,但当我尝试使用 $ lein plugin install 甚至 $lein help 时,我得到下面粘贴了堆栈跟踪。我猜这是一个设置问题,但我无法在网上查找信息或找到正确的开始查找位置。安装 lein 时,我按照 Leiningen GitHub 页面 上的说明进行操作。

Exception in thread "main" java.lang.ExceptionInInitializerError (NO_SOURCE_FILE:0)
    at clojure.lang.Compiler.eval(Compiler.java:5440)
    at clojure.lang.Compiler.eval(Compiler.java:5391)
    at clojure.core$eval.invoke(core.clj:2382)
    at clojure.main$eval_opt.invoke(main.clj:235)
    at clojure.main$initialize.invoke(main.clj:254)
    at clojure.main$script_opt.invoke(main.clj:270)
    at clojure.main$main.doInvoke(main.clj:354)
    at clojure.lang.RestFn.invoke(RestFn.java:457)
    at clojure.lang.Var.invoke(Var.java:377)
    at clojure.lang.AFn.applyToHelper(AFn.java:172)
    at clojure.lang.Var.applyTo(Var.java:482)
    at clojure.main.main(main.java:37)
Caused by: java.lang.ExceptionInInitializerError
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at clojure.lang.RT.loadClassForName(RT.java:1578)
    at clojure.lang.RT.load(RT.java:399)
    at clojure.lang.RT.load(RT.java:381)
    at clojure.core$load$fn__4519.invoke(core.clj:4915)
    at clojure.core$load.doInvoke(core.clj:4914)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invoke(core.clj:4729)
    at clojure.core$load_lib.doInvoke(core.clj:4766)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invoke(core.clj:542)
    at clojure.core$load_libs.doInvoke(core.clj:4800)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invoke(core.clj:542)
    at clojure.core$require.doInvoke(core.clj:4881)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at leiningen.core$resolve_task.invoke(core.clj:175)
    at leiningen.core$apply_task.invoke(core.clj:225)
    at leiningen.core$_main.doInvoke(core.clj:294)
    at clojure.lang.RestFn.invoke(RestFn.java:410)
    at clojure.lang.AFn.applyToHelper(AFn.java:161)
    at clojure.lang.RestFn.applyTo(RestFn.java:132)
    at clojure.core$apply.invoke(core.clj:542)
    at leiningen.core$_main.invoke(core.clj:297)
    at user$eval42.invoke(NO_SOURCE_FILE:1)
    at clojure.lang.Compiler.eval(Compiler.java:5424)
    ... 11 more
Caused by: java.lang.RuntimeException: java.util.zip.ZipException: zip file is empty
    at clojure.lang.LazySeq.sval(LazySeq.java:47)
    at clojure.lang.LazySeq.seq(LazySeq.java:56)
    at clojure.lang.RT.seq(RT.java:450)
    at clojure.core$seq.invoke(core.clj:122)
    at clojure.core$apply.invoke(core.clj:540)
    at clojure.core$mapcat.doInvoke(core.clj:2122)
    at clojure.lang.RestFn.invoke(RestFn.java:423)
    at leiningen.util.ns$namespaces_matching.invoke(ns.clj:67)
    at leiningen.help__init.load(Unknown Source)
    at leiningen.help__init.<clinit>(Unknown Source)
    ... 38 more
Caused by: java.util.zip.ZipException: zip file is empty
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(Unknown Source)
    at java.util.zip.ZipFile.<init>(Unknown Source)
    at java.util.jar.JarFile.<init>(Unknown Source)
    at java.util.jar.JarFile.<init>(Unknown Source)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at clojure.lang.Reflector.invokeConstructor(Reflector.java:160)
    at leiningen.util.ns$namespaces_in_jar.invoke(ns.clj:53)
    at clojure.core$map$fn__3699.invoke(core.clj:2096)
    at clojure.lang.LazySeq.sval(LazySeq.java:42)
    ... 47 more

I'm a beginner getting started with using Clojure and Leiningen, and I've run into a problem trying to use a variety of lein commands. Although $ lein deps works fine, when I tried to use $ lein plugin install <plugin>, or even $lein help, I get the stack trace pasted below. I would guess that this is a setup issue, but I'm having trouble finding information online or finding the right place to start looking. When installing lein I followed the instructions on the Leiningen GitHub page.

Exception in thread "main" java.lang.ExceptionInInitializerError (NO_SOURCE_FILE:0)
    at clojure.lang.Compiler.eval(Compiler.java:5440)
    at clojure.lang.Compiler.eval(Compiler.java:5391)
    at clojure.core$eval.invoke(core.clj:2382)
    at clojure.main$eval_opt.invoke(main.clj:235)
    at clojure.main$initialize.invoke(main.clj:254)
    at clojure.main$script_opt.invoke(main.clj:270)
    at clojure.main$main.doInvoke(main.clj:354)
    at clojure.lang.RestFn.invoke(RestFn.java:457)
    at clojure.lang.Var.invoke(Var.java:377)
    at clojure.lang.AFn.applyToHelper(AFn.java:172)
    at clojure.lang.Var.applyTo(Var.java:482)
    at clojure.main.main(main.java:37)
Caused by: java.lang.ExceptionInInitializerError
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at clojure.lang.RT.loadClassForName(RT.java:1578)
    at clojure.lang.RT.load(RT.java:399)
    at clojure.lang.RT.load(RT.java:381)
    at clojure.core$load$fn__4519.invoke(core.clj:4915)
    at clojure.core$load.doInvoke(core.clj:4914)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invoke(core.clj:4729)
    at clojure.core$load_lib.doInvoke(core.clj:4766)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invoke(core.clj:542)
    at clojure.core$load_libs.doInvoke(core.clj:4800)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invoke(core.clj:542)
    at clojure.core$require.doInvoke(core.clj:4881)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at leiningen.core$resolve_task.invoke(core.clj:175)
    at leiningen.core$apply_task.invoke(core.clj:225)
    at leiningen.core$_main.doInvoke(core.clj:294)
    at clojure.lang.RestFn.invoke(RestFn.java:410)
    at clojure.lang.AFn.applyToHelper(AFn.java:161)
    at clojure.lang.RestFn.applyTo(RestFn.java:132)
    at clojure.core$apply.invoke(core.clj:542)
    at leiningen.core$_main.invoke(core.clj:297)
    at user$eval42.invoke(NO_SOURCE_FILE:1)
    at clojure.lang.Compiler.eval(Compiler.java:5424)
    ... 11 more
Caused by: java.lang.RuntimeException: java.util.zip.ZipException: zip file is empty
    at clojure.lang.LazySeq.sval(LazySeq.java:47)
    at clojure.lang.LazySeq.seq(LazySeq.java:56)
    at clojure.lang.RT.seq(RT.java:450)
    at clojure.core$seq.invoke(core.clj:122)
    at clojure.core$apply.invoke(core.clj:540)
    at clojure.core$mapcat.doInvoke(core.clj:2122)
    at clojure.lang.RestFn.invoke(RestFn.java:423)
    at leiningen.util.ns$namespaces_matching.invoke(ns.clj:67)
    at leiningen.help__init.load(Unknown Source)
    at leiningen.help__init.<clinit>(Unknown Source)
    ... 38 more
Caused by: java.util.zip.ZipException: zip file is empty
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(Unknown Source)
    at java.util.zip.ZipFile.<init>(Unknown Source)
    at java.util.jar.JarFile.<init>(Unknown Source)
    at java.util.jar.JarFile.<init>(Unknown Source)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at clojure.lang.Reflector.invokeConstructor(Reflector.java:160)
    at leiningen.util.ns$namespaces_in_jar.invoke(ns.clj:53)
    at clojure.core$map$fn__3699.invoke(core.clj:2096)
    at clojure.lang.LazySeq.sval(LazySeq.java:42)
    ... 47 more

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我是男神闪亮亮 2024-12-09 11:15:42

(为了因果报应;o)您是否尝试过删除 .lein 目录并从零重新运行?听起来您可能缓存了损坏的 zip 文件。

(For the karma ;o) Have you tried deleting the .lein directory and re-running from zero? Sounds like you may have a corrupt zip file cached.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文