Fork me on GitHub
#leiningen
<
2016-02-29
>
cpmcdaniel16:02:12

nyone know how to get lein install (with :aot :all) to not include *.clj source files in the artifact?

cpmcdaniel16:02:27

found it - :omit-source true

cpmcdaniel16:02:18

… except it didn’t work 😉

cpmcdaniel16:02:24

nevermind, my profile wasn’t active

yogidevbear16:02:07

I was looking at the first lein uberjar example in Clojure for the Brave and True (http://www.braveclojure.com/getting-started/), but when I try run the jar file using java -jar target/uberjar/clojure-noob-0.1.0-SNAPSHOT-standalone.jar I get the following error:

Exception in thread "main" java.lang.NoClassDefFoundError: clojure/lang/Var
        at clojure_noob.core.<clinit>(Unknown Source)
Caused by: java.lang.ClassNotFoundException: clojure.lang.Var
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 1 more
Any ideas / suggestions?

tolitius16:02:49

looks like you are missing a clojure dep

tolitius16:02:51

e.g. :dependencies [[org.clojure/clojure "1.8.0"]]

tolitius16:02:58

in your project.clj

yogidevbear16:02:22

Do I need to do anything specific to pull it down from the web?

tolitius16:02:36

no, lein does it (via maven)

tolitius16:02:02

have not gone through the book, what does your project.clj look like?

yogidevbear16:02:21

I've literally run lein new app clojure-noob followed by lein uberjar

yogidevbear16:02:34

If I do lein run it works

yogidevbear16:02:38

but the jar doesn't

yogidevbear16:02:52

(defproject clojure-noob "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url ""
  :license {:name "Eclipse Public License"
            :url ""}
  :dependencies [[org.clojure/clojure "1.8.0"]]
  :main ^:skip-aot clojure-noob.core
  :target-path "target/%s"
  :profiles {:uberjar {:aot :all}})

tolitius16:02:01

$ lein new app clojure-noob
Generating a project called clojure-noob based on the 'app' template.
$ cd clojure-noob

$ lein run
Hello, World!

$ lein uberjar
Compiling clojure-noob.core
Created .../clojure-noob/target/uberjar+uberjar/clojure-noob-0.1.0-SNAPSHOT.jar
Created .../clojure-noob/target/uberjar/clojure-noob-0.1.0-SNAPSHOT-standalone.jar

$ java -jar target/uberjar/clojure-noob-0.1.0-SNAPSHOT-standalone.jar
Hello, World!

tolitius16:02:40

try a different (fresh) shell and directory maybe?

yogidevbear17:02:52

Thanks @tolitius. Closing the shell and reopening it and running all the code again seemed to resolve the issue.

tolitius17:02:47

sure, happy clojure'ing simple_smile

fenton21:02:32

is there a way to dump what lein is doing in a more verbose way...like what are the accumulated settings its created for the various project.clj/profiles.clj etc...

ccann23:02:34

has anyone seen this before

Caused by: java.io.FileNotFoundException: Could not locate clojure/tools/reader/impl/ExceptionInfo__init.class or clojure/tools/reader/impl/ExceptionInfo.clj on classpath.
?

ccann23:02:11

leiningen 2.6.1

ccann23:02:45

desperate for a fix for it

nberger23:02:09

@ccann it looks like a dependency conflict. Check with lein deps :tree if you have multiple versions of clojure.tools.reader being pulled