Iam trying for HOURS now and cant figure out the problem.
Iam new to clojure and try to make a simple flickr client.
But I have this problem with different libraries… I think I make a general mistake.
At the moment I try to use oauth with this lib: https://github.com/mattrepl/clj-oauth
lein new projectname
and my project.clj looks like this:
(defproject flickr "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.4.0"]
[clj-oauth "1.4.0"]])
After adding the clj-oauth2 I run:
lein deps
And my core.clj:
(ns flickr.core)
(require ['oauth.client :as 'oauth])
(def consumer-key "0000")
(def consumer-secret "0000")
(def consumer (oauth.client/make-consumer <consumer-token>
<consumer-token-secret>
"http://www.flickr.com/services/oauth/request_token"
"http://www.flickr.com/services/oauth/access_token"
"http://www.flickr.com/services/oauth/authorize"
:hmac-sha1))
When I now try to run it:
lein run
I get:
FileNotFoundException Could not locate oauth/client__init.class or oauth/client.clj on classpath: clojure.lang.RT.load (RT.java:432)
Does anyone has an idea where the problem is?
Also also downloaded the oauth source from the github repo, built it and added it to my $PATH variable but still the same error.
Any help would be appreciated!
Thanks!
First,
lein runlooks for a main namespace, whose name must be specified inproject.cljusing the:mainkey; add:main flickr.corethere.Then you need a
-mainfunction inflickr.core. Change your namespace declaration and add the function as follows:Then,
That worked for me as a sort of “namespace smoke test,” and you should be able to go from there.
(As a final note, your development will go much faster if you test these sorts of things in the REPL rather than using ‘lein run.’)