New Luminus application gives error: could not find or load main class clojure.main
I just created a Luminus app by running:
lein new luminus foobar
and when i try to run it with master like this:
foreman start
way of describing documents, I am getting this error:
Error: Could not find or load main class clojure.main
which is also the same error i get from Heroku. The Procfile generated by the template contains the following:
web: java $JVM_OPTS -cp target/foobar.jar clojure.main -m foobar.core
What's going on, how to fix it?
+3
source to share
2 answers
My best guess is that you need to build a project with a team lein uberjar
. This sequence works:
$ lein new luminus foobar
Retrieving ...
Generating a Luminus project.
$ cd foobar
$ lein uberjar
Retrieving ...
Compiling foobar.session
Compiling foobar.layout
Compiling foobar.handler
Compiling foobar.routes.home
Compiling foobar.core
Compiling foobar.middleware
Created /home/ba/foobar/target/foobar-0.1.0-SNAPSHOT.jar
Created /home/ba/foobar/target/foobar.jar
$ cat Procfile
web: java $JVM_OPTS -cp target/foobar.jar clojure.main -m foobar.core
$ java $JVM_OPTS -cp target/foobar.jar clojure.main -m foobar.core
2015-Jun-22 06:30:42 -0400 ba INFO [foobar.handler] -
-=[ foobar started successfully nil ]=-
2015-06-22 06:30:42.998:INFO:oejs.Server:jetty-7.x.y-SNAPSHOT
2015-06-22 06:30:43.028:INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:3000
+7
source to share