4 ms·
You can't actually use the Clojure jar like this with java -jar as it has a couple of dependent libs (spec.alpha and core.specs.alpha). But getting started with
by puredanger 7y ago
You can't actually use the Clojure jar like this with java -jar as it has a couple of dependent libs (spec.alpha and core.specs.alpha). But getting started with the `clj` tool is just as easy.
- emmanueloga_ 7y agoMy bad! I tested it my system and it worked, but I'm sure I have the jars in the classpath already because I had already installed Clojure through a packet manager. So! Clojure 1.8 still works without dependencies for trying the jar [1]. Otherwise, I'd skip to installing 1.10 through the system installer. 1: https://repo1.maven.org/maven2/org/clojure/clojure/1.8.0/ https://repo1.maven.org/maven2/org/clojure/clojure/1.8.0/
- bmillare 7y agoSee my post above, just build the clojure jar yourself using the ant instructions, and it will be portable again.
- bmillare 7y agoYou can if you build the clojure jar yourself. Just follow the ant part of the clojure README to generate your own jar. Then you have a super portable clojure jar again. https://github.com/clojure/clojure/ https://github.com/clojure/clojure/
- emmanueloga_ 7y agoThis is cool, though for lowering the barrier of entry downloading a single jar is great. If ppl is first coming to Clojure w/o too much knowledge of java, having to install Ant first, clone a repo and build it manually could be a bit daunting.
- seancorfield 7y agoOn macOS: brew install clojure Linux can use brew as well, or just download an installer shell script and run it. Windows can use an (alpha) installer for Powershell or use Scoop via this bucket https://github.com/littleli/scoop-clojure https://github.com/littleli/scoop-clojure That's for the official CLI that works with deps.edn files for dependencies. You can also download Leiningen -- a single shell script (macOS/Linux) or batch script (Windows). If you use brew/scoop, I don't think you even need a JVM installed as they will do that automatically.
- bmillare 7y agoMy suggestion is mainly for people that want to "trim the fat" , have maximal control of things, or want to use this as basis for non-standard deployments. I just want to support the OP that you don't NEED to download all this tooling to get it to run on any computer. Once you have the jar, its very easy to put it on a friend's computer. You can even package up a JVM in there if you wanted too. While not up to date, I describe my motivations in dj.solo https://github.com/bmillare/dj.solo https://github.com/bmillare/dj.solo