Nutch-Cygwin How to set JAVA_HOME

霸气de小男生 提交于 2020-01-03 11:11:49

问题


i am trying to run Nutch with Cygwin. I am having problems setting the JAVA_HOME.

 $ export JAVA_HOME='/cygdrive/f/program files/java/jdk1.6.0_21'

When i run nutch command

$ bin/nutch crawl

i get

cygpath: can't convert empty path
bin/nutch: line 268: /cygdrive/f/program: No such file or directory
bin/nutch: line 268: exec: /cygdrive/f/program: cannot execute: No such file or directory

It appears that the space between program and files causes the problem /cygdrive/f/**program files**/java/jdk1.6.0_21

Is there a way that i can escape the space? Is there a better way to do this? Thanks

EDIT

At the end of the day, i had to re-install java in another directory with no space in its name.


回答1:


Try to use double quotes in:

export JAVA_HOME="/cygdrive/f/program files/java/jdk1.6.0_21"

and wherever the script uses the JAVA_HOME variable, for example:

JAVA="$JAVA_HOME"/bin/java

Regards



来源:https://stackoverflow.com/questions/9345629/nutch-cygwin-how-to-set-java-home

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!