gen-class

Why can't Leiningen always use my :gen-class properly?

送分小仙女□ 提交于 2019-12-22 06:41:40
问题 Let's say I create a new Leiningen project ( lein new app example ) and add some code in example/src/example/core.clj that makes use of :gen-class : (ns example.core (:gen-class :extends javafx.application.Application)) (defn -start [this stage] (.show stage)) (defn -main [& args] (javafx.application.Application/launch example.core args)) If I then create a JAR ( lein uberjar ) and run it, everything works fine. However, if I instead try to run my app directly ( lein run ), I get a

Why can't Leiningen always use my :gen-class properly?

放肆的年华 提交于 2019-12-05 10:45:23
Let's say I create a new Leiningen project ( lein new app example ) and add some code in example/src/example/core.clj that makes use of :gen-class : (ns example.core (:gen-class :extends javafx.application.Application)) (defn -start [this stage] (.show stage)) (defn -main [& args] (javafx.application.Application/launch example.core args)) If I then create a JAR ( lein uberjar ) and run it, everything works fine. However, if I instead try to run my app directly ( lein run ), I get a ClassNotFoundException . In addition, if I open a REPL ( lein repl ), I first get the same error as before, but