I have a problem with importing jars in clojure. I used lein to add dependencies. This is code from project.clj
(defproject recommendation "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"]
[org.clojure/java.jdbc "0.0.6"] ;; jdbc
[mysql/mysql-connector-java "5.1.6"]]
:aot :all
:main recommendation.core)
I typed in the command lein deps
, and it downloaded 3 jars in lib folder.
This is code from recommendation.core
(ns recommendation.core
(:require [clojure.java.jdbc :as sql]) )
And I get exception:
FileNotFoundException Could not locate clojure/java/jdbc__init.class or clojure/java/jdbc.clj on classpath: clojure.lang.RT.load (RT.java:443)
Can anybody tell me where i am wrong and what to do?
here's my dependency line:
[org.clojure/java.jdbc "0.2.3"]
Heres the require line from one of my projects that use jdbc
(:require [clojure.java [jdbc :as sql]])
If none of this helps here are my standard leiningen fixing steps:
PS: I found this video helpful in getting a handle on namespaces.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With