Reputation: 603
I've been striving to build a standalone .jar with leiningen. Though having gone through the examples on github and Alex Ott's Website and some related questions, I couldn't figure out how to correctly set up the project. After doing lein uberjar
in the project it complains
Could not locate clojure/contrib/string__init.class or clojure/contrib/string.clj on classpath: (collision.clj:1)
My project directory looks like
.
├── classes
├── lib
│ ├── clojure-1.2.1.jar
│ └── clojure-contrib-1.1.0.jar
├── project.clj
└── src
└── collision
└── collision.clj
My project.clj
:
(defproject collision "1.0.0-SNAPSHOT"
:description "FIXME: write description"
:dependencies [[org.clojure/clojure "1.2.1"]
[org.clojure/clojure-contrib "1.1.0"]]
:main collision.collision)
collision.clj
:
(ns collision.collision
(:require
clojure.set
clojure.string
[clojure.contrib.string :as st]
[clojure.contrib.str-utils :as su]
[clojure.contrib.combinatorics :as cmbn]))
... defns ...
(defn -main []
(...))
(-main)
The code works on the REPL. How do I tell leiningen where to to find clojure-contrib-1.1.0.jar
? I'm not a Java programmer and not really accustomed to the classpath issue; quick and dirty help is much appreciated.
Upvotes: 3
Views: 997
Reputation: 797
try using [org.clojure/clojure-contrib "1.2.0"]
instead [org.clojure/clojure-contrib "1.1.0"]
in the version 1.1.0 not exist the namespace clojure.contrib.string
Upvotes: 1