1

I am trying to set JAVA_HOME in env.sh in Hadoop. I am using Cygwin on Windows 7. I have edited the env.sh as:

export JAVA_HOME= "/cygdrive/C/Program Files/Java/jdk1.6.0_26"

In environment variables I have set JAVA_HOME as C:\Program Files\Java\jdk1.6.0_26.

And the path as %JAVA_HOME%\bin;c:\cygwin\bin;c:\cygwin\usr\sbin.

But still I am getting these errors:

/cygdrive/d/hadoop-1.2.1/libexec/../conf/hadoop-env.sh: line 2: $'\r': command not found

/cygdrive/d/hadoop-1.2.1/libexec/../conf/hadoop-env.sh: line 7: $'\r': command not found

': not a valid identifierlibexec/../conf/hadoop-env.sh: line 9: export: 

`/cygdrive/C/Program Files/Java/jdk1.6.0_26


/cygdrive/d/hadoop-1.2.1/libexec/../conf/hadoop-env.sh: line 12: $'\r': command not found

/cygdrive/d/hadoop-1.2.1/libexec/../conf/hadoop-env.sh: line 41: $'\r': command not found


/cygdrive/d/hadoop-1.2.1/libexec/../conf/hadoop-env.sh: line 46: $'\r': command not found


/cygdrive/d/hadoop-1.2.1/libexec/../conf/hadoop-env.sh: line 52: $'\r': command not found


/cygdrive/d/hadoop-1.2.1/libexec/../conf/hadoop-env.sh: line 55: $'\r': command not found


Error: JAVA_HOME is not set.

When I am doing echo $JAVA_HOME, it is giving C:\Program Files\Java\jdk1.6.0_26. I have checked everything possible on this website, but still facing the problem.

4
  • shouldn;t this export JAVA_HOME= "/cygdrive/C/Program Files/Java/jdk1.6.0_26" be export JAVA_HOME= "/cygdrive/C:/Program Files/Java/jdk1.6.0_26"
    – Satya
    Sep 28, 2013 at 7:30
  • @satya That dosenot make a difference.
    – user861938
    Sep 28, 2013 at 7:34
  • try this then export JAVA_HOME= "/cygdrive/'C:/Program Files/Java/jdk1.6.0_26'"
    – Satya
    Sep 28, 2013 at 7:38
  • I have already tried this. same error
    – user861938
    Sep 28, 2013 at 7:41

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.