Ok, I solved my original problem. It is embarrassing to admit it, but I think I should do it for the sake of completeness of this topic. I messed up with my ways. I have the same file in the Netbeans project and in the leiningen project. And I edited the Netbeans file. Unfortunately.
But then I had another problem. The main method is found, but I get
java.lang.IllegalArgumentException: Wrong number of args (0) passed to: core $ -main
I tried changing my main method from (defn -main [_] ...) to (defn -main [& args] ...) as Arthur suggested, but that didn't work. To solve this problem, I wrote simply (defn -main[]...) with no arguments.
The next problem was that calling (init) from (main) led to an error. I worked on this without invoking (init) at all, but invoking (exploding-dots) directly from (main) .
So for everything to work, my src/explodingdots/core.clj looks like
(ns explodingdots.core
(: import (java.awt Color Dimension Graphics2D AlphaComposite RenderingHints)
(java.awt.event ActionListener MouseAdapter WindowAdapter)
(javax.swing Timer JPanel JFrame))
(: gen-class))
[...]
(defn -main [] (exploding-dots))
After looking at the solution, I should think about why I did not write it right now. This is the easiest and most direct way. Maybe I need a vacation;).
source share