3
votes

I just installed leiningen and am following the tutorial on how to start. I typed

lein new my-stuff and then corrected the project.clj file as per the instructions. Then I type lein repl and it pulls up the repl fine. The next step is to type

(require 'my-stuff.core)

This is where I get

FileNotFoundException Could not locate my_stuff/core__init.class or my_stuff/core.clj on classpath: clojure.lang.RT.load (TR.java:432)

I have tried looking at my classpath, but everything looks alright.

lein classpath

C:\Users\Sarah\leiningen\test;C:\Users\Sarah\leiningen\src;C:Users\Sarah\leiningen\dev-resources;C:\Useres\Sarah\leiningen\resources;C:\Users\Sarah\leiningen\target\classes;C:\Useres\Sarah\.m2\repository\org\clojure\clojure\1.4.0\clojure-1.4.0.jar

Any help would be great!

1

1 Answers

2
votes

I suspect that the problem here is stemming from your choice of project name. Although you can create Clojure namespaces with hyphens in them, the corresponding physical files and directories need to have the hyphen replaced with an underscore.

As you are just experimenting, the easiest thing for you to do would be to start again with a different project name: try lein new mystuff for example.

If you want to press on with my-stuff then try renaming the src\my-stuff directory to src\my_stuff and doing the same for test\my-stuff if it exists.

To be honest, I'm a little surprised that Leiningen has got this wrong, so there may be something else at work here, or you might just be using an old version of Leiningen.