Java环境位置不是“有效标识符" [英] Java environment location is 'not a valid identifier'

查看:188
本文介绍了Java环境位置不是“有效标识符"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在hadoop-env.sh文件中手动设置JAVA_HOME变量,但是根据Cygwin的说法,我的Java bin文件的路径是不是有效的标识符".

I'm trying to set my JAVA_HOME variable in my hadoop-env.sh file manually, but the path to my Java bin file is 'not a valid identifier' according to Cygwin.

我收到以下错误消息,我相信我已经正确地转义了所有特殊字符

I get the following error message, I believe I have escaped all special characters correctly

S@W27 /cygdrive/c/hadoop-1.2.1
 $ bin/hadoop
 /cygdrive/c/hadoop-1.2.1/libexec/../conf/hadoop-env.sh: line 9: export: 
 `C:\Program Files (x86)\Java\jre7': not a valid identifier

我尝试了相同的文件路径,并使用正斜杠,最后也使用了/bin/java,但没有成功.

I have tried the same file path with forward slashes, and also with /bin/java at the end but with no success.

为什么路径无效?

推荐答案

嘿,西蒙,路径应以" 为正斜杠或无反斜杠的后斜杠,如下所示:-

hey Simon the path should be with " " in forward slash or in backward slash without qoute like this :-

export JAVA_HOME="C:\Program Files (x86)\Java\jre7"
export JAVA_HOME=/Program Files (x86)/Java/jre7   #(as the root is C drive)

在hadoop安装中,严格提到必须将JAVA路径设置为

and in hadoop installation it is strictly mentioned that you have to set your JAVA path to

export JAVA_HOME="C:\Java\jre8"

不应位于程序文件中.

这篇关于Java环境位置不是“有效标识符"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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