Sirgeorge
Sirgeorge

Reputation: 137

Syntax error (FileNotFoundException) Could not locate [name].class, [name].clj or [name].cljc on classpath

Error message above for clojure project working with Leiningen. Can't get it to actually pick up this library. Every time I run "lein deps" it pauses for a second then outputs nothing before returning. This is almost a bone stock project. What's going wrong. Don't be afraid to ask for more info. Don't know what I'm missing to give if I'm given nothing to know I'm missing ;).

core.clj:

(ns file-name.core
  (:gen-class)
  (:use [dimovich.roll]))

(defn -main
 "I don't do a whole lot ... yet."
[& args]
(println "Hello, World!")
)

project.clj:

(defproject file-name "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
            :url "https://www.eclipse.org/legal/epl-2.0/"}
  :dependencies [[org.clojure/clojure "1.10.1"]
                 [dimovich/roll "0.3.2"]]
  :main ^:skip-aot hospital-price-site.core
  :target-path "target/%s"
  :profiles {:uberjar {:aot :all
                       :jvm-opts ["-Dclojure.compiler.direct-linking=true"]}})

Upvotes: 0

Views: 1071

Answers (2)

gleitonfranco
gleitonfranco

Reputation: 799

Try :require instead of :use, and check if the file dimovich/roll.clj actually exists.

Upvotes: 0

amalloy
amalloy

Reputation: 92147

There is no such namespace as dimovich.roll: namespaces are not the same thing as maven coordinates. Observe the files in https://github.com/dimovich/roll/tree/master/src/clj/roll. To use a function from the library, you need to know where it lives, and load the appropriate namespace.

Upvotes: 1

Related Questions