2

This should be a simple problem to solve but every time I try to compile I am getting class not found exceptions caused by the fact that leininigen is trying to compile classes in the wrong order. I've gone as far as trying to explicitly define the order classes should be compiled on the project.clj file using the :aot but that is being ignored. The files that are getting class not found exceptions have :require statements in the ns declaration but they are also being ignored. How can I change the compile order?

I have used lein clean because I had some stale classes that the system was refusing to overwrite and now it won't compile at all. I am getting very frustrated with this language as it seems nothing works the way it should.

Here is an example error I'm getting (replaced base namespace with )

Exception in thread "main" java.lang.NoClassDefFoundError: <MyProject>/util$loading__4910__auto__, compiling:(obj.clj:1:1)

The file that it is failing in contains ...

(ns <MyProject>.obj
  (:gen-class)
  (:require <MyProject>.util)
)

util.clj contains...

(ns <MyProject>.util
  (:gen-class)
)

project.clj contains...

  :aot [
    ;...
    <MyProject>.util
    <MyProject>.obj
    ;...
  ]
NielsK
  • 6,886
  • 1
  • 24
  • 46
Ralph Ritoch
  • 3,260
  • 27
  • 37
  • 1
    From your tags you are running this from Eclipse (CCW I assume ?). There are some issues with CCW switching to a new run model, especially on windows. Does this work as expected when doing a 'lein run' from the commandline ? Does it work from either CCW or commandline when removing all (:gen-class) and :aot directives ? – NielsK Apr 14 '14 at 09:38
  • @NielsK, I actually was able to resolve the issue by rebooting, running lein clean, followed by lein compile. I still would like to know how to repair this issue without a reboot though. – Ralph Ritoch Apr 14 '14 at 09:45
  • @NielsK to answer your question, I'm using eclipse Counterclockwise plugin. I don't have leininigen installed outside of eclipse so lein tools aren't available in my command shell, only through eclipse. – Ralph Ritoch Apr 14 '14 at 09:49
  • @NeilsK at your suggestion I installed Leiningen stand-alone and it seems to be more reliable than the one eclipse uses as it actually exits after a compile and isn't leaving 100's of JDE sessions open like the eclipse one does. I suspect the problem here is the version of lein used by the counterclockwise plugin. – Ralph Ritoch Apr 14 '14 at 10:21
  • I suspect it's got more to do with issues of the Eclipse / CCW subprocess launching code that's used to launch leiningen. There's several discussions going on at the Counterclockwise Google Group about the current woes. Previous ones made me switch to IntelliJ with the Cursive plugin, since especially Windows gets hit hardest with these problems. – NielsK Apr 14 '14 at 11:18

0 Answers0