I’m still fairly new to Clojure so I apologize if this is a completely newbie question but I wasn’t able to find a sufficient answer online.
Basically, my problem is that any time I try to run my project, I get an error like:
Exception in thread "main" java.lang.RuntimeException: java.io.FileNotFoundException: Could not locate greeter__init.class or greeter.clj on classpath:
In this case, greeter.clj is in the project in the same directory as the file containing my main function.
For illustration purposes, I’ve created a project that has a directory tree like this:

My code for core.clj is as follows:
(ns omg.core
(require [greeter]))
(defn -main[] (greet))
My code for greeter.clj is:
(ns greeter)
(defn greet [] println("Hello world"))
Whenever I type lein run -m omg.core I get the exception mentioned above. What am I doing wrong?
the greeter namespace it at the wrong level
The names in namespace correspond to the folders in the path so to use the file in
/src/omg/greeter.clj that file should contain the
omg.greeternamespace. if you want to have it just calledgreeterthen move it down one folderWhen using
requireyou need to spell out the namespace of the function you are calling, in this case that would be(omg.greeter/greet). since this is a pain, theusefunction requires a namespace and adds all it’s functions to the current namespace. Another option that is more selective is to use require with a :refer option in the namespace definitionor
Most people put the namespace requirements into the
nscall at the top of the file.a quick read of http://clojure.org/namespaces will hopefully help