1
이 코드는 lein compile
으로 컴파일되지 않습니다. 중요한 부분은 gen-class
및 -main
기능입니다. 이 코드는 JavaFX 8과 Clojure 1.7을 사용합니다. 그러나 이것은 단지 세부 사항입니다. 내 질문에 대한 AOT 컴파일 및 생성 된 클래스를 참조하는 방법에 대한 것입니다.Alo 컴파일에서 Clojure 생성 클래스를 참조 하시겠습니까?
(ns the.app
(:import
[javafx.application Application]
[javafx.scene Scene]
[javafx.scene.layout StackPane]
[javafx.stage Stage])
(:gen-class
:name the.app.App
:extends javafx.application.Application
:main true))
(defn start
[^Application app
^Stage stage
{:keys [width height title] :as opts}]
(let [root (StackPane.)
scene (Scene. root width height)]
(if title (.setTitle stage title))
(.setScene stage scene)
(.show stage)))
(defn -start
[app stage]
(start app stage {:title "App" :width 800 :height 600}))
(defn -stop
[app]
(println "-stop"))
(defn -main
[& args]
(Application/launch the.app.App args))
내 project.clj
다음이 포함
:dependencies [[org.clojure/clojure "1.7.0-alpha4"]]
:aot [the.app]
:main the.app
오류 메시지는 다음과 같습니다
Caused by: java.lang.ClassNotFoundException: the.app.App
내가 컴파일하는 the.app.App
을 만들 것이라고 생각했을 것이다. 클래스 compiled from AOT을 참조하는 문제를 어떻게 해결할 수 있습니까?