How to setup the classpath when running the jar made from 'lein uberjar'?

时光总嘲笑我的痴心妄想 提交于 2019-12-05 09:02:16

You put hello.clj under src/myproject so it's ns should be myproject.hello. With this file structure, I would expect hello.clj to say (ns myproject.hello) and for core.clj to say (use 'myproject.hello).

When I make those changes, I get:

$ java -jar myproject-standalone.jar a b c
Welcome to my project! These are your args: (a b c)
hello
HI

clj should be inside your project-root/src. With that it should work. For an example of a similar project, see leiningen project. The lancet namespace is inside src:

http://github.com/technomancy/leiningen/tree/master/src/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!