Gastove
Gastove

Reputation: 916

Clojure REPL Import trouble-shooting

Okay. I'm trying to muck about with twitter4j inside a Clojure REPL, provided by Leiningen. I've specified twitter4j as a build dependency:

(defproject testproject "0.1.0-SNAPSHOT"
  :description "Tryin stuff"
  :repositories {
                 "twitter4j" "http://twitter4j.org/maven2"
                 }
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [compojure "1.1.6"]
                 [org.twitter4j/twitter4j-core "3.0.5"]
                 [org.twitter4j/twitter4j-stream "3.0.5"]]
  :plugins [[lein-ring "0.8.8"]]
  :ring {:handler testproject.core/app}
  :profiles {:dev
             {:dependencies [[javax.servlet/servlet-api "2.5"]
                        [ring-mock "0.1.5"]]}})

So far, so good. lein deps downloads everything without complaint into the default repo in ~/.m2. Awesome. I fire up the REPL, and I get this and only this:

user=> (import '(org.twitter4j.conf ConfigurationBuilder))

ClassNotFoundException org.twitter4j.conf.ConfigurationBuilder  java.net.URLClassLoader$1.run (URLClassLoader.java:202)

The twitter4j jars are all present and accounted for, in ~/.m2/org/twitter4j/twitter4j-core/3.0.5/. Is there... something I don't get about importing Java classes? Some extra config I need to provide?

Upvotes: 0

Views: 160

Answers (1)

Ankur
Ankur

Reputation: 33637

Try this (the proper package name):

user=> (import '(twitter4j.conf ConfigurationBuilder))

Upvotes: 2

Related Questions