I'm trying to set my JAVA_HOME in Cygwin with this command:
export JAVA_HOME="/cygdrive/c/Program Files/Java/jdk1.7.0_10"
But when I do cd $JAVA_HOME
, I'd get this error:
$ cd $JAVA_HOME
-bash: cd: /cygdrive/c/Program: No such file or directory
I tried quoting, and escaping the space (ie., \
), but none worked.
Any idea what else would?
Thanks,
You set JAVA_HOME
correctly. Now let's cd
correctly too.
cd "$JAVA_HOME"
Try using the DOS subst command to take the spaces of the JAVA_HOME path name. Assuming drive J; is not mounted or otherwise used.
In a DOS shell
subst j: "C:/Program Files/Java/jdk1.7.0_45"
J: is now an abbreviation for C:/Program Files/Java/jdk1.7.0_45
You can now cd to J:
now run Cygwin and
export JAVA_HOME="J:"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With