问题描述
具体使用leberen uberjar。
java -cp myapp.jar clojure.main -r
给我一个repl,但是默认为用户命名空间
我需要做什么才能得到它的myapp的命名空间?
java -cp myapp.jar clojure.main -e(in-ns myapp.core)
给我clojure.lang.LispReader $ ReaderException
更新*
最终目标是简单运行java -jar myapp.jar
,并在我的应用程序的命名空间中有一个Clojure REPL。
我看到的每个解决方案都涉及到在命令行上编写我想要放入我的main方法但似乎不能运行的代码。(defn -main [& args]
(clojure.main / main-e(in-ns myapp.core)))
立即完成/终止
解决方案
java -cp myapp.jar clojure.main -m myapp.core
Specifically with a leiningen uberjar.
java -cp myapp.jar clojure.main -r
gets me a repl but defaults to the user namespaceWhat do I need to do to get it to myapp's namespace?
java -cp myapp.jar clojure.main -e (in-ns myapp.core)
gives me clojure.lang.LispReader$ReaderException
* Update *The ultimate goal is to simply run
java -jar myapp.jar
and have a Clojure REPL in my app's namespace.Every solution I've seen involves writing code on the command line that I want to put into my main method but can't seem to get running
(defn -main [&args] (clojure.main/main "-e" "(in-ns myapp.core)"))
completes/terminates immediately
解决方案
java -cp myapp.jar clojure.main -m myapp.core
这篇关于如何在不同的命名空间中打开一个repl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!