Maybe I’m missing something or just reading outdated information. Basically, I’m trying to use the CSV lib here.
I’ve included it in my project.clj…
:dependencies [[org.clojure/clojure "1.3.0"]
[org.clojure/data.csv "0.1.2"]]
…and retrieved the libs successfully using Leiningen. Now, what would be the proper way to include this lib for use in my program? I’ve tried the example posted on the lib’s Github page only to get an error stating:
FileNotFoundException Could not locate clojure/data/csv__init.class or clojure/data/csv.clj on classpath: clojure.lang.RT.load (RT.java:430)
EDIT: Further clarification on what I’ve tried: I have the code pasted under my namespace declaration, like so:
(ns testprogram.core(:gen-class))
(require '[clojure.data.csv :as csv]
'[clojure.java.io :as io])
Trying it in the REPL yields the same result. I’m pretty sure I’m trying to ‘include’ them wrong.
This test worked for me:
I also encountered the “FileNotFound: could not locate” issue while testing this out. It was a simple typo in my
project.cljfile. I recommend double-checking that.Note: this also worked:
While using the
:requiredirective in thensmacro is certainly a best practice, is is not the source of the issue here.In both versions, REPL output:
Also tested with
lein runandjava -cp <uberjar> test.csv_test