ninjudd / drip

Fast JVM launching without the hassle of persistent JVMs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Example with jar file other than clojure.jar?

eigenhombre opened this issue · comments

I'd like to try running drip with Clojure programs more complicated than '(* 3 3)' or a stand-alone REPL; e.g., say I have done 'lein uberjar' and made a standalone jar file. I imagine it would be possible to use drip'ped JVM to run that as well, but was unable to figure out the incantation for that (drip -cp blah-standalone.jar X fails where X is, well, any of a dozen things I tried).

I figured others would be interested in this too, perhaps in the README? Hence this ticket. Thanks!

Not an expert on the matter, but if it is an executable jar file, I imagine you could run it the same way you would with java: drip -jar yourjarfile.jar

That'd be nice, but, no:

drip -cp chrs-1.0.0-SNAPSHOT-standalone.jar
Exception in thread "main" java.lang.NoClassDefFoundError:
Caused by: java.lang.ClassNotFoundException:
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
(django-pydev-venv)08:16:29 target (master) > Exception in thread "main" java.lang.ClassNotFoundException:
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at org.flatland.drip.Main.mainMethod(Main.java:94)
at org.flatland.drip.Main.start(Main.java:70)
at org.flatland.drip.Main.main(Main.java:64)

Same if you remove the -standalone and use the other jar made by lein uberjar.

I said drip -jar yourjarfile.jar, not drip -cp yourjarfile.jar.

Ah, oops. That did it, thanks!! Closing issue.

Actually I might make a PR putting this as an example in the docs.

Awesome! I'm here at the conj. If you see me, come say hello.