oakes / play-clj

A Clojure game library
The Unlicense
939 stars 73 forks source link

game example doesn't work with lein uberjar #3

Closed greggaree closed 10 years ago

greggaree commented 10 years ago

I downloaded the zip file from play-clj-examples and extracted a game example. While I was able to run the platform game in lein repl or lein run, I couldn't get it to run after executing lein uberjar. Instead, I receive this error:

C:...platform game> java -jar target\super-koalio-0.0.1-SNAPSHOT.jar
Exception in thread "main" java.lang.NoClassDefFoundError: clojure/lang/IFn
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2531)
        at java.lang.Class.getMethod0(Class.java:2774)
        at java.lang.Class.getMethod(Class.java:1663)
        at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)
Caused by: java.lang.ClassNotFoundException: clojure.lang.IFn
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
        ... 6 more

Greg

oakes commented 10 years ago

There should be a second jar file in the target directory called "super-koalio-0.0.1-SNAPSHOT-standalone.jar". You'll need to run that one, because the non-standalone jar doesn't contain all the dependencies. Let me know if you still have problems.

greggaree commented 10 years ago

I was using the auto-complete feature to type out the rest of the jar path, Windows completed with the regular version of the jar. D'oh! I didn't realize lein uberjar creates two jars.

Many Thanks!