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
To avoid using the tedious Windows environment variables, and also use the actual path string copied from Windows explorer, I suggest adding the following to your startup script:
             TMP=`cygpath -sw "C:\Program Files\Java\jdk1.8.0_31"`
export JAVA_HOME=`cygpath -u $TMP`
The first cygpath invocation obtains a short, windows path; the second converts it to unix format, which works fine in cygwin.
This will also now work fine:
$ cd $JAVA_HOME