gpt4 book ai didi

java - 无法在类路径中找到 seesaw/core.clj?

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:22:43 24 4
gpt4 key购买 nike

我正在尝试使用 Clojure 的跷跷板制作一个小窗口。但是,当我尝试使用以下方法创建 JAR 文件时:

lein uberjar

我在 Windows 命令行上收到以下错误:

Caused by: clojure.lang.Compiler$CompilerException: java.io.FileNotFoundExceptio
n: Could not locate seesaw/core__init.class or seesaw/core.clj on classpath: ,
compiling:(C:\Users\J\Desktop\test\guidemo\project.clj:10:36)

使用 leiningen,我创建了一个新应用程序并在我的 project.clj 中包含以下内容

(defproject guidemo "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.6.0"]
[seesaw "1.4.4"]]
:main ^:skip-aot guidemo.core
:target-path "target/%s"
:profiles {:uberjar {:aot :all}})

(ns guidemo.namespace
(:gen-class)
(:require [seesaw.core :as seesaw]))

和以下在 core.clj 中创建一个简单的窗口(都在我的 guidemo 项目中)

(ns guidemo.core
(:gen-class)
(:require [seesaw.core :as seesaw]))

(def window (seesaw/frame
:title "First Example"
:content "hello world"
:width 200
:height 50))

(defn -main
[& args]
(seesaw/show! window))

我的问题是如何在我的类路径上设置 seesaw/core.clj?我对 leiningen 的场景和使用跷跷板还很陌生。我见过 daveray 回答的大多数示例都与在 seesaw 中试验示例有关。除了这个项目,我在其他项目上运行 lein 操作(lein help,lein compile)没有问题。

我已经在 daveray 的 github 上下载了 seesaw 的整个 repo。那应该在我的 guidemo 文件夹中吗?如果是,在哪里?

我正在运行 leiningen 2.5.0。在 Java 1.7.0_67 上

感谢大家的帮助,在过去的 4 个小时里,我一直在努力设置一切。

最佳答案

您的“project.clj”中不需要以下内容

(ns guidemo.namespace
(:gen-class)
(:require [seesaw.core :as seesaw]))

关于java - 无法在类路径中找到 seesaw/core.clj?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26876761/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com