Question

Anytime I fire up a fresh REPL I always get the same message, namely

#<FileNotFoundException java.io.FileNotFoundException: Could not locate test_app/core_init.class or test_app/core.cljon classpath:>

The namespace I've been using is ns test-app.core

The REPL still continues to come up and I am able to execute code with it. I am just unsure if this will lead to future problems, such as trying to work with incanter or other libraries.

Was it helpful?

Solution

Does your project.clj contain the following line, per chance?

...
:main test-app.core
...

Leiningen will try to switch into that namespace before showing the REPL to you. If it cannot find it, you'll see the error you mentioned. Now, the reason it cannot find it is another topic to explore, so first make sure that this is how your directory structure looks like:

.
|-- project.clj
|-- src
    |-- test_app
        |-- core.clj

If it does, I guess it's time to post Leiningen and Java versions (and ideally your project.clj) to let SO try to tackle this miraculous REPL. :)

Edit: The solution to this problem would - if any of the above suggestions match your case - of course be to either remove the :main line from your project file or to adjust the directory structure.

OTHER TIPS

There needs to be a core.clj file in the folder named test_app in your project structure.

Basically, the file name should apply the naming towards whatever you've declared in your ns form.

As the Clojure Documentation FAQ says,

In order to use a Java class or Clojure namespace in your program, that class or namespace must be "on the classpath," that is, inside a directory or JAR file listed in the classpath.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top