Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Boot example
> mkdir -p foo/src/foo
> cd foo
> echo "(ns foo.core (:gen-class)) (defn -main [& args] (println \"Hello, world\"))" > src/foo/core.clj
> boot -s src pom -p foo -v 0.1.0 jar -m foo.core
Writing pom.xml and pom.properties...
Writing foo-0.1.0.jar...
> java -jar target/foo-0.1.0.jar
Error: Could not find or load main class foo.core
> boot -s src pom -p foo -v 0.1.0 uber jar -m foo.core
Writing pom.xml and pom.properties...
Adding uberjar entries...
Writing foo-0.1.0.jar...
> java -jar target/foo-0.1.0.jar
Error: Could not find or load main class foo.core
> boot -s src pom -p foo -v 0.1.0 aot --all uber jar -m foo.core
Writing pom.xml and pom.properties...
Compiling 1/1 foo.core...
Adding uberjar entries...
Writing foo-0.1.0.jar...
> java -jar target/foo-0.1.0.jar
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: clojure/lang/IFn
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: clojure.lang.IFn
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 7 more
> boot -s src -d org.clojure/clojure:1.6.0 pom -p foo -v 0.1.0 uber jar -m foo.core
Writing pom.xml and pom.properties...
Adding uberjar entries...
Writing foo-0.1.0.jar...
> java -jar target/foo-0.1.0.jar
Error: Could not find or load main class foo.core
> boot -s src -d org.clojure/clojure:1.6.0 pom -p foo -v 0.1.0 aot --all uber jar -m foo.core
Writing pom.xml and pom.properties...
Compiling 1/1 foo.core...
Adding uberjar entries...
Writing foo-0.1.0.jar...
> java -jar target/foo-0.1.0.jar
Hello, world
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.