0

It is possible to call Windows Environment Variables in a bat script by defining e.g. %JAVA_HOME%. It looks like this is not possible using CygWin and shell scripts. Is it possible to call Windows Environment Variables in shell scripts? This would be handy for the configuration and running of an Unix package on Windows. Otherwise the JAVA_HOME needs to change everytime the Java version has been updated.

/cygdrive/c/hbase/hbase-0.94.19/bin/hbase: line 231: %JAVA_HOME%/bin/java: No su
ch file or directory
/cygdrive/c/hbase/hbase-0.94.19/bin/hbase: line 365: /cygdrive/c/hbase/hbase-0.9
4.19/%JAVA_HOME%/bin/java: No such file or directory
/cygdrive/c/hbase/hbase-0.94.19/bin/hbase: line 365: exec: /cygdrive/c/hbase/hba
se-0.94.19/%JAVA_HOME%/bin/java: cannot execute: No such file or directory
/cygdrive/c/hbase/hbase-0.94.19/bin/hbase: line 231: %JAVA_HOME%/bin/java: No su
ch file or directory
/cygdrive/c/hbase/hbase-0.94.19/bin/hbase: line 365: /cygdrive/c/hbase/hbase-0.9
4.19/%JAVA_HOME%/bin/java: No such file or directory
/cygdrive/c/hbase/hbase-0.94.19/bin/hbase: line 365: exec: /cygdrive/c/hbase/hba
se-0.94.19/%JAVA_HOME%/bin/java: cannot execute: No such file or directory
  • 1
    You probably have to use the syntax of your shell to access the variable. For example $JAVA_HOME$ – Der Hochstapler May 25 '14 at 13:13
1

If you're using a POSIX shell, it's probably $JAVA_HOME.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.