Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not locate clojure/test/check__init.class, clojure/test/check.clj or clojure/test/check.cljc on classpath

I'm new to Clojure and Lisp as a whole. Following Chapter 14 of the Getting Clojure book, it suggests loading clojure.test.check.generators in a way that appeared to me as if it's a native library embedded in clojure.test.

Turns out it's not. Trying to (require '[clojure.test.check.generators]) gives an error:

Could not locate clojure/test/check__init.class, clojure/test/check.clj or clojure/test/check.cljc on classpath.

like image 594
Renato Byrro Avatar asked Dec 22 '22 16:12

Renato Byrro


1 Answers

The book doesn't instruct clearly that I needed to properly declare check as a project dependency before trying to require it.

What I needed to do is to open project.clj file and, under :dependencies add this: [org.clojure/test.check "1.1.0"]. Check the latest version on the library's repo.

I'm documenting here since searching for the error string returned nothing straightforward for me to fix the issue. Although this seems pretty basic, this response should save a few minutes of digging around from other people that are also just starting out.

like image 122
Renato Byrro Avatar answered Apr 27 '23 22:04

Renato Byrro