Search code examples
clojureread-eval-print-loopincanter

Problems while opening the REPL


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.


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.