Warm tip: This article is reproduced from serverfault.com, please click

Java environment location is 'not a valid identifier'

发布于 2013-09-19 21:04:59

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

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

Why is the path invalid?

Questioner
Simon Hayward
Viewed
0
Aashu 2013-09-20 15:15:21

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)

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

export JAVA_HOME="C:\Java\jre8"

that should not be inside the program files.