This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-09-24
Channels
- # admin-announcements (17)
- # alda (5)
- # aws (4)
- # beginners (19)
- # boot (80)
- # bristol-clojurians (3)
- # cider (15)
- # clojure (257)
- # clojure-berlin (1)
- # clojure-czech (1)
- # clojure-indonesia (1)
- # clojure-nl (1)
- # clojure-poland (1)
- # clojure-russia (77)
- # clojurescript (186)
- # core-async (7)
- # core-typed (6)
- # cursive (8)
- # datomic (2)
- # devcards (2)
- # editors (45)
- # emacs (23)
- # hoplon (83)
- # jobs (1)
- # ldnclj (106)
- # leiningen (43)
- # off-topic (4)
- # onyx (31)
- # reagent (10)
- # yada (1)
I'm running lein 2.5.3 with the 1.8.0_60 Oracle JDK, and unless I set :java-cmd
in my profile, I get this when running lein:
Compilation failed: Cannot run program "java" (in directory "/home/jmglov/Documents/code/origin-shield-test"): error=2, No such file or directory
But I have java
in my path, and the environment set up:
: jmglov@laurana; which java
/home/jmglov/Software/jdk/bin/java
: jmglov@laurana; env | grep 'JAVA\|JDK'
JAVA_HOME=/home/jmglov/Software/jdk
JAVAC=/home/jmglov/Software/jdk/bin/javac
JDK_HOME=/home/jmglov/Software/jdk
: jmglov@laurana; java -version
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
This started happening after I moved to a new laptop. The strange thing is that I am using the same home directory as before, so nothing should have changed.
I upgraded leiningen to the latest version (I was using a previous 2.x version before, though I don't remember exactly which), but same problem.
jmglov: do you have something funny set in the project's profiles.clj or ~/.lein/profiles.clj?
@ian: Here's my complete ~/.lein/profiles.clj
:
{:user {:dependencies [[org.clojure/tools.nrepl "0.2.10"]
[pjstadig/humane-test-output "0.6.0"]]
:injections [(require 'pjstadig.humane-test-output)
(pjstadig.humane-test-output/activate!)]
:plugins [[cider/cider-nrepl "0.9.1"]
[lein-pprint "1.1.1"]
[lein-try "0.4.1"]]
:java-cmd "/home/jmglov/Software/jdk/bin/java"}}
And the project.clj
in question:
(defproject origin-shield-test "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url ""}
:dependencies [[org.clojure/clojure "1.7.0"]
[clj-http "2.0.0"]]
:main origin-shield-test.core
:profiles {:uberjar {:aot :all
:java-cmd "/home/jmglov/Software/jdk/bin/java"}})
But this problem has shown up in all of my lein projects, so it isn't specific to this project.
I poked around in the lein source, but I can't even figure out what is generating the Compilation failed: Cannot run program "java" ...
error message.
I suppose I could set an uberjar profile in ~/.lein/profiles.clj
, but that's just working around the problem.
there could be something funny with the lein binary itself maybe? but that wouldn't really make sense..
unfortunately I'm not sure. 😞 the few other people around the internet that have had this issue seem to just be satisfied with using the :java-cmd method you're using now. I know it would bother me as well, but I'm not smart enough to help you.