Reputation: 287400
I just created a Luminus app by running:
lein new luminus foobar
and when I try to run it with foreman like this:
foreman start
the way the docs describe, I get this error:
Error: Could not find or load main class clojure.main
which is also the same error I get from Heroku. The Procfile that the template created contains this:
web: java $JVM_OPTS -cp target/foobar.jar clojure.main -m foobar.core
What's going on, how do I fix it?
Upvotes: 3
Views: 2570
Reputation: 146
Regarding Luminus and the Procfile, see this diff.
Fixed upstream but you can fix it in your app by changing your Procfile from:
web: java $JVM_OPTS -cp target/foobar.jar clojure.main -m foobar.core
to:
web: java $JVM_OPTS -cp target/uberjar/foobar.jar clojure.main -m foobar.core
Upvotes: 2
Reputation: 503
My best guess is that you need to build the project with the command 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 [email protected]:3000
Upvotes: 8