Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lein does not specify Main-Class for app template #2208

Closed
achikin opened this issue Sep 17, 2016 · 2 comments
Closed

lein does not specify Main-Class for app template #2208

achikin opened this issue Sep 17, 2016 · 2 comments
Labels

Comments

@achikin
Copy link

achikin commented Sep 17, 2016

~/src → lein new app wonderland
Generating a project called wonderland based on the 'app' template.
~/src → cd wonderland/
~/src/wonderland → lein jar
Warning: The Main-Class specified does not exist within the jar. It may not be executable as expected. A gen-class directive may be missing in the namespace which contains the main method.
Created /Users/achikin/src/wonderland/target/wonderland-0.1.0-SNAPSHOT.jar
~/src/wonderland → cat src/wonderland/core.clj
(ns wonderland.core
  (:gen-class))

(defn -main
  "I don't do a whole lot ... yet."
  [& args]
  (println "Hello, World!"))

Am I missing anything?

@hypirion
Copy link
Collaborator

Perhaps you intended to use lein uberjar? That would bundle all the dependencies and create a standalone version which is runnable.

I think it's pretty rare to use jar for standalone apps, because then you have to provide all dependencies (Clojure including) and the like yourself, in which case you're a real poweruser of Leiningen.

Perhaps we should add a "maybe you meant uberjar?" message when this happens?

@hypirion hypirion added the docs label Sep 18, 2016
@achikin
Copy link
Author

achikin commented Sep 18, 2016

uberjar did the job, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants