I'm trying to use functions from other jar files.
Creation of local jar file
I downloaded sample sources from the book Programming Clojure 2nd Ed, and created a jar file with lein jar
command.
Use the local jar file
From the hints in this post, I copied the jar file in lib/
directory, then I could add
:resource-paths ["lib/programming-clojure-1.3.0.jar"]
in the project.clj.
Test in REPL
With lein classpath
command, I could check that the jar file is in class path.
With lein repl
, I could use the functions in the jar file.
mire=> (require '[examples.introduction :as e])
nil
mire=> (take 10 examples.introduction/fibs)
(0 1 1 2 3 5 8 13 21 34)
Isses with emacs/cider
I created a t.clj source in the src/
directory, launched emacs with emacs src/t.clj &
, and started REPL with M-x cider-jack-in
.
I wrote this code, and executed it with C-x C-e
.
(ns t (:require '[examples/introduction :as ex]))
However, I got a message that the file is not found.
java.io.FileNotFoundException: Could not locate introduction__init.class or introduction.clj on
classpath:
What might be wrong?