2
votes

I'm 100% new to clojure/lein.

The project.clj looks like so

    (defproject pio-cache "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"]
                 [clj-http "0.9.2"]]
     :main pio-cache.core/main

     )

And my core file looks like

(ns pio-cache.core
   (:require [clj-http.client :as client])
)

But i can't use clj-http. When i try to run it i keep getting:

java.io.FileNotFoundException: Could not locate clj_http/client__init.class or clj_http/client.clj on classpath

I've tried running lein deps and lein classpath. Nothing fixes it.

Edit - Adding lein deps :tree

    [clj-http "0.9.2"]
       [cheshire "5.3.1" :exclusions [[org.clojure/clojure]]]
         [com.fasterxml.jackson.core/jackson-core "2.3.1"]
         [com.fasterxml.jackson.dataformat/jackson-dataformat-smile "2.3.1"]
         [tigris "0.1.1"]
       [commons-codec "1.9" :exclusions [[org.clojure/clojure]]]
       [commons-io "2.4" :exclusions [[org.clojure/clojure]]]
       [crouton "0.1.2" :exclusions [[org.clojure/clojure]]]
         [org.jsoup/jsoup "1.7.1"]
       [org.apache.httpcomponents/httpclient "4.3.3" :exclusions [[org.clojure/clojure]]]
         [commons-logging "1.1.3"]
       [org.apache.httpcomponents/httpcore "4.3.2" :exclusions [[org.clojure/clojure]]]
       [org.apache.httpcomponents/httpmime "4.3.3" :exclusions [[org.clojure/clojure]]]
       [org.clojure/tools.reader "0.8.4" :exclusions [[org.clojure/clojure]]]
       [potemkin "0.3.4" :exclusions [[org.clojure/clojure]]]
         [clj-tuple "0.1.2"]
         [riddley "0.1.6"]
       [slingshot "0.10.3" :exclusions [[org.clojure/clojure]]]
     [clojure-complete "0.2.3" :exclusions [[org.clojure/clojure]]]
     [org.clojure/clojure "1.6.0"]
     [org.clojure/tools.nrepl "0.2.3" :exclusions [[org.clojure/clojure]]]
1
I can't reproduce any issue -- after getting rid of the reference to pio-cache.core/main (since you aren't actually providing one), seems perfectly fine here. - Charles Duffy
@CharlesDuffy how are classpath issues like this normally fixed? - Micah
Well -- I'd start by running (and adding to your question the output from) lein deps-tree. This will also give us some hints about your environment (for instance, if you're loading any leiningen plugins conflicting with the desired dependency chain). - Charles Duffy
...*normally*, when there's a library problem, it's because something else is conflicting with what you're asking for -- resulting in a newer version being used than what you wanted, or a library that has conflicting classes added by mistake, or whatnot. Your dependency chain is so simple here as to make that unlikely, which is why this question is... unusual. Unless you have big hairy lein plugins in use. :) - Charles Duffy
...and, yeah, that's pretty straightforward. You're getting a newer Clojure runtime than the one you asked for, but that shouldn't generally hurt things. - Charles Duffy

1 Answers

0
votes

I went into another directory, had lein generate a ring-based app template and download its dependencies, then came back into this project's directory and suddenly the dependency download just started working.... ?