Note that there are some explanatory texts on larger screens.

plurals
  1. POStandalone clojure app
    text
    copied!<p>I'm a beginner with clojure, only starting it yesterday.</p> <p>I have gathered that a simple way to create a standalone app is with leiningen <code>lein new foo</code>.</p> <p>I tried to create a hello world test project with leiningen. I added :main and :aot directives to project.clj, added :gen-class to the core.clj file and tried <code>lein run</code>, but I get errors about class definition not found.</p> <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: Caused by: java.lang.ClassNotFoundException: at java.net.URLClassLoader$1.run(URLClassLoader.java:217) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:321) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) at java.lang.ClassLoader.loadClass(ClassLoader.java:266) </code></pre> <p>The core.clj file</p> <pre><code>(ns test.core (:gen-class)) (defn -main [&amp; args] (println "Hello main")) </code></pre> <p>And the project.clj file</p> <pre><code>(defproject test "1.0.0-SNAPSHOT" :description "FIXME: write description" :main test.core :aot [test.core] :dependencies [[org.clojure/clojure "1.2.1"]]) </code></pre> <p><em>Edit:</em> After further testing, it seems like copying the project to my desktop works as is, which I think points to that the environment on my laptop is somehow borked, but I don't know how.</p> <p>The environment on desktop is clojure from repositories and leiningen from AUR. On laptop the clojure is from clojure.org and leining is from github. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload