获取Leiningen& Cygwin工作 [英] Getting Leiningen & Cygwin Working

查看:215
本文介绍了获取Leiningen& Cygwin工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想让Leiningen和Cygwin一起工作。



我认为我有一个问题是我在C:\Program Files \Java ...目录。



当我尝试在Cygwin中运行lein脚本时,会出现以下错误:

  ./ lein:line 325:C:\Program Files\Java\jdk1.8.0_05\bin\java.exe:command not found 

然后我认为问题是空间。所以我改变了第325行:

 $ LEIN_JAVA_CMD\ 
pre>

(用于测试目的):

  C:\\\Program Files\\\Java\\\\jdk1.8.0_05\\\bin\\\java.exe\ 

但是,我仍然收到此错误:

  ./ lein:line 325:$'C:\\Program Files\\Java\\\jdk1.8.0_05\\\bin\\java。 exe':commande introuvable 

但是,这个文件明显存在:

  Owner @ PC〜
$ ls -alh $'C:\\Program Files\\Java\\jdk1。 8.0_05 \\bin\\java.exe'
-rwxr-xr-x 1所有者无187K 8 mai 15:39 C:\Program Files\Java\jdk1.8.0_05\\ \\bin \java.exe

lein



请注意,我之前在之前安装了Leiningen 的Cygwin(我在Windows的正常shell中运行它)。



我的设置可能有什么问题,任何想法?

解决方案

我使用Leiningen通过Cygwin没有问题。



重新开始



重新开始使用lein脚本的新副本。



设置您的PATH以包含java



最简单的解决方案是在〜/ .profile 中设置路径以包括Java的bin目录的路径。然后Lein会在路径上找到java,你将可以访问你的shell中的java及其相关工具。

  export JAVA_HOME =/ cygdrive / c / Program Files / Java / jdk1.8.0_05 /
export PATH =$ {JAVA_HOME} / bin /:$ {PATH}

重新启动shell或 source〜/ .profile 。验证哪个java 找到java命令。然后运行 java 以验证您是否获得帮助输出。



并且/或显式设置 LEIN_JAVA_CMD JAVA_CMD 变量



lein在〜/ .profile

中使用的变量LEIN_JAVA_CMD 和 JAVA_CMD

  export JAVA_HOME =/ cygdrive / c / Program Files / Java / jdk1.8.0_05 /
export LEIN_JAVA_CMD =$ { JAVA_HOME} / bin / java
export JAVA_CMD =`cygpath -w$ {LEIN_JAVA_CMD}`


$ b b

重新启动shell或 source〜/ .profile



注意:您还可以设置单独的 LEIN_JVM_OPTS JVM_OPTS 如果需要,但这不是必要的。


I am trying to get Leiningen and Cygwin working together.

One of the problems I think I have is that I have Java installed in "C:\Program Files\Java..." directory. The space appears to be causing issues.

When I try to run the lein script in Cygwin, I am getting the following error:

./lein: line 325: C:\Program Files\Java\jdk1.8.0_05\bin\java.exe : command not found

Then I thought the issue was the space. So I changed line 325 from:

"$LEIN_JAVA_CMD" \

to (for testing purposes):

"$'C:\\\Program Files\\\Java\\\jdk1.8.0_05\\\bin\\\java.exe'" \

But, I am still getting this error:

./lein: line 325: $'C:\\Program Files\\Java\\jdk1.8.0_05\\bin\\java.exe' : commande introuvable

However, this file clearly exists:

Owner@Owner-PC ~
$ ls -alh $'C:\\Program Files\\Java\\jdk1.8.0_05\\bin\\java.exe'
-rwxr-xr-x 1 Owner None 187K  8 mai   15:39 C:\Program Files\Java\jdk1.8.0_05\bin\java.exe

The lein script appears to be properly configuring Leiningen for Cygwin, however I can't get it to work.

Note that I previously installed Leiningen outside of Cygwin (I was running it in Windows' normal shell).

What could be wrong with my setup, any ideas?

解决方案

I use Leiningen via Cygwin with no problems.

Start over

Start over with a fresh copy of the lein script. There should be no need to edit it.

Set your PATH to include java

The easiest solution is to set your path in ~/.profile to include the path to Java's bin directory. Lein will then find java on the path and you'll have access to java and its related tools in your shell.

export JAVA_HOME="/cygdrive/c/Program Files/Java/jdk1.8.0_05/"
export PATH="${JAVA_HOME}/bin/:${PATH}"

Restart your shell or source ~/.profile. Verify that which java finds java command. And run java to verify you get the help output.

And/or explicitly set the LEIN_JAVA_CMD and JAVA_CMD variables

Alternatively, set the LEIN_JAVA_CMD and JAVA_CMD variables used by lein in your ~/.profile

export JAVA_HOME="/cygdrive/c/Program Files/Java/jdk1.8.0_05/"
export LEIN_JAVA_CMD="${JAVA_HOME}/bin/java"
export JAVA_CMD=`cygpath -w "${LEIN_JAVA_CMD}"`

Restart your shell or source ~/.profile.

Note: You can also set a separate LEIN_JVM_OPTS and JVM_OPTS if desired, but this should not be necessary.

这篇关于获取Leiningen& Cygwin工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆