Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clojure could not locate __init.class in clojars dependency

I am getting the common clojure error:

Unhandled java.io.FileNotFoundException
Could not locate org/dsteurer/doctex__init.class or
org/dsteurer/doctex.clj on classpath.

The correct file is in my project.clj :dependencies as [org.dsteurer/doctex "0.1.10"] and the files from that project are in my .m2 directory.

If I clean out the .m2 repository and restart the REPL the files from doctex are downloaded and added to the .m2 repository but the error persists.

There is no file doctex.clj. There are files core.clj and main.clj and main.clj has a :gen-class in the ns. Looking at other clojar downloads I find many which only have a core.clj and do not have a "projectname.clj" file so I'm confused. I've got dozens of clojure projects and many dozens of dependencies and this problem (where dependencies are correct and .m2 is filled correctly) is new.

like image 345
John Daschbach Avatar asked Feb 10 '26 14:02

John Daschbach


1 Answers

You are probably requiring the wrong namespace (org.dsteurer.doctex).

One frequently used default namespace is core, so perhaps try

(:require [doctex.core])

The documentation of the library should include that information somewhere.

like image 53
glts Avatar answered Feb 15 '26 12:02

glts



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!