technomancy / leiningen

Moved to Codeberg; this is a convenience mirror
https://codeberg.org/leiningen/leiningen
Other
7.29k stars 1.6k forks source link

lein install does not work properly in Cygwin #1976

Open bluebear94 opened 9 years ago

bluebear94 commented 9 years ago

(from trying to build boot-clj/boot)

(cd boot/worker && lein install)
java.io.IOException: Cannot run program "/cygdrive/c/Program Files/Java/jdk1.8.0_51/bin/java" (in directory "C:\cygwin64\home\tkook\boot\boot\worker"): CreateProcess error=2, The system cannot find the file specified
 at java.lang.ProcessBuilder.start (ProcessBuilder.java:1048)
    java.lang.Runtime.exec (Runtime.java:620)
    sun.reflect.NativeMethodAccessorImpl.invoke0 (NativeMethodAccessorImpl.java:-2)
    sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    java.lang.reflect.Method.invoke (Method.java:497)
    clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:93)
    clojure.lang.Reflector.invokeInstanceMethod (Reflector.java:28)
    leiningen.core.eval$sh.doInvoke (eval.clj:167)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invoke (core.clj:630)
    leiningen.core.eval/fn (eval.clj:234)
    clojure.lang.MultiFn.invoke (MultiFn.java:233)
    leiningen.javac$run_javac_subprocess.invoke (javac.clj:119)
    leiningen.javac$javac.doInvoke (javac.clj:138)
    clojure.lang.RestFn.invoke (RestFn.java:410)
    clojure.lang.Var.invoke (Var.java:379)
    clojure.lang.AFn.applyToHelper (AFn.java:154)
    clojure.lang.Var.applyTo (Var.java:700)
    clojure.core$apply.invoke (core.clj:632)
    leiningen.core.main$partial_task$fn__6414.doInvoke (main.clj:261)
    clojure.lang.RestFn.invoke (RestFn.java:410)
    clojure.lang.AFn.applyToHelper (AFn.java:154)
    clojure.lang.RestFn.applyTo (RestFn.java:132)
    clojure.lang.AFunction$1.doInvoke (AFunction.java:29)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invoke (core.clj:632)
    leiningen.core.main$apply_task.invoke (main.clj:311)
    leiningen.core.eval$run_prep_tasks.invoke (eval.clj:50)
    leiningen.core.eval$prep.invoke (eval.clj:65)
    leiningen.jar$build_jar.invoke (jar.clj:288)
    leiningen.jar$main_jar.invoke (jar.clj:297)
    leiningen.jar$jar.invoke (jar.clj:348)
    leiningen.jar$jar.invoke (jar.clj:350)
    leiningen.install$install.invoke (install.clj:19)
    clojure.lang.Var.invoke (Var.java:379)
    clojure.lang.AFn.applyToHelper (AFn.java:154)
    clojure.lang.Var.applyTo (Var.java:700)
    clojure.core$apply.invoke (core.clj:632)
    leiningen.core.main$partial_task$fn__6414.doInvoke (main.clj:261)
    clojure.lang.RestFn.invoke (RestFn.java:410)
    clojure.lang.AFn.applyToHelper (AFn.java:154)
    clojure.lang.RestFn.applyTo (RestFn.java:132)
    clojure.lang.AFunction$1.doInvoke (AFunction.java:29)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invoke (core.clj:632)
    leiningen.core.main$apply_task.invoke (main.clj:311)
    leiningen.core.main$resolve_and_apply.invoke (main.clj:317)
    leiningen.core.main$_main$fn__6480.invoke (main.clj:390)
    leiningen.core.main$_main.doInvoke (main.clj:383)
    clojure.lang.RestFn.invoke (RestFn.java:408)
    clojure.lang.Var.invoke (Var.java:379)
    clojure.lang.AFn.applyToHelper (AFn.java:154)
    clojure.lang.Var.applyTo (Var.java:700)
    clojure.core$apply.invoke (core.clj:630)
    clojure.main$main_opt.invoke (main.clj:316)
    clojure.main$main.doInvoke (main.clj:421)
    clojure.lang.RestFn.invoke (RestFn.java:436)
    clojure.lang.Var.invoke (Var.java:388)
    clojure.lang.AFn.applyToHelper (AFn.java:160)
    clojure.lang.Var.applyTo (Var.java:700)
    clojure.main.main (main.java:37)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
 at java.lang.ProcessImpl.create (ProcessImpl.java:-2)
    java.lang.ProcessImpl.<init> (ProcessImpl.java:386)
    java.lang.ProcessImpl.start (ProcessImpl.java:137)
    java.lang.ProcessBuilder.start (ProcessBuilder.java:1029)
    java.lang.Runtime.exec (Runtime.java:620)
    sun.reflect.NativeMethodAccessorImpl.invoke0 (NativeMethodAccessorImpl.java:-2)
    sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    java.lang.reflect.Method.invoke (Method.java:497)
    clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:93)
    clojure.lang.Reflector.invokeInstanceMethod (Reflector.java:28)
    leiningen.core.eval$sh.doInvoke (eval.clj:167)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invoke (core.clj:630)
    leiningen.core.eval/fn (eval.clj:234)
    clojure.lang.MultiFn.invoke (MultiFn.java:233)
    leiningen.javac$run_javac_subprocess.invoke (javac.clj:119)
    leiningen.javac$javac.doInvoke (javac.clj:138)
    clojure.lang.RestFn.invoke (RestFn.java:410)
    clojure.lang.Var.invoke (Var.java:379)
    clojure.lang.AFn.applyToHelper (AFn.java:154)
    clojure.lang.Var.applyTo (Var.java:700)
    clojure.core$apply.invoke (core.clj:632)
    leiningen.core.main$partial_task$fn__6414.doInvoke (main.clj:261)
    clojure.lang.RestFn.invoke (RestFn.java:410)
    clojure.lang.AFn.applyToHelper (AFn.java:154)
    clojure.lang.RestFn.applyTo (RestFn.java:132)
    clojure.lang.AFunction$1.doInvoke (AFunction.java:29)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invoke (core.clj:632)
    leiningen.core.main$apply_task.invoke (main.clj:311)
    leiningen.core.eval$run_prep_tasks.invoke (eval.clj:50)
    leiningen.core.eval$prep.invoke (eval.clj:65)
    leiningen.jar$build_jar.invoke (jar.clj:288)
    leiningen.jar$main_jar.invoke (jar.clj:297)
    leiningen.jar$jar.invoke (jar.clj:348)
    leiningen.jar$jar.invoke (jar.clj:350)
    leiningen.install$install.invoke (install.clj:19)
    clojure.lang.Var.invoke (Var.java:379)
    clojure.lang.AFn.applyToHelper (AFn.java:154)
    clojure.lang.Var.applyTo (Var.java:700)
    clojure.core$apply.invoke (core.clj:632)
    leiningen.core.main$partial_task$fn__6414.doInvoke (main.clj:261)
    clojure.lang.RestFn.invoke (RestFn.java:410)
    clojure.lang.AFn.applyToHelper (AFn.java:154)
    clojure.lang.RestFn.applyTo (RestFn.java:132)
    clojure.lang.AFunction$1.doInvoke (AFunction.java:29)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invoke (core.clj:632)
    leiningen.core.main$apply_task.invoke (main.clj:311)
    leiningen.core.main$resolve_and_apply.invoke (main.clj:317)
    leiningen.core.main$_main$fn__6480.invoke (main.clj:390)
    leiningen.core.main$_main.doInvoke (main.clj:383)
    clojure.lang.RestFn.invoke (RestFn.java:408)
    clojure.lang.Var.invoke (Var.java:379)
    clojure.lang.AFn.applyToHelper (AFn.java:154)
    clojure.lang.Var.applyTo (Var.java:700)
    clojure.core$apply.invoke (core.clj:630)
    clojure.main$main_opt.invoke (main.clj:316)
    clojure.main$main.doInvoke (main.clj:421)
    clojure.lang.RestFn.invoke (RestFn.java:436)
    clojure.lang.Var.invoke (Var.java:388)
    clojure.lang.AFn.applyToHelper (AFn.java:160)
    clojure.lang.Var.applyTo (Var.java:700)
    clojure.main.main (main.java:37)
Makefile:64: recipe for target 'boot/worker/target/worker-2.2.0.jar' failed
make: *** [boot/worker/target/worker-2.2.0.jar] Error 1

JAVA_CMD is set to /cygdrive/c/Program\ Files/Java/jdk1.8.0_51/bin/java

This error is probably caused by using a Java version built for Windows, which can't recognize such file names. However, it will be difficult to resolve since now we would need two separate variables for the Java path, and the solution is probably not worth the effort.

thjwong commented 8 years ago

I encounter a similar problem, the script cannot resolve windows path for JDK's java executable file. Here is what I got:

HTTP request sent, awaiting response... 200 OK Length: 15768731 (15M) [application/octet-stream] Saving to: ‘D:\home\john.lein/self-installs/leiningen-2.5.3-standalone.jar.pending’

D:\home\jwong.lein/se 100%[============================>] 15.04M 1.54MB/s in 13s

2015-12-08 19:47:12 (1.13 MB/s) - ‘D:\home\john.lein/self-installs/leiningen-2.5.3-standalone.jar.pending’ saved [15768731/15768731]

/cygdrive/d/home/john/bin/lein: line 359: C:\Program Files\Java\jdk1.8.0_65\bin\java.exe: command not found