Search code examples
clojure

Why does this program not run in Cursive?


It does neither compile nor run in Cursive:

(ns test)
(defn -main "This should be pretty simple."
  []
  (javax.swing.JOptionPane/showMessageDialog nil "Hello World"))

The file is named test.clj. It is the only file in the whole project. I get to see the green arrow on the left side, but when I click it - it says Nothing here. When I try to run it - I get

Error: Could not find or load main class clojure.main

Solution

  • Turns out you need to create a specific clojure module/project in Cursive. You cannot just put a clojure file and hope, that it will get compiled and executed.