export JAVA_HOME with spaces in Cygwin

后端 未结 7 942
失恋的感觉
失恋的感觉 2020-12-19 01:47

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

7条回答
  •  再見小時候
    2020-12-19 02:35

    Try to use short name to avoid a space in a path.

    "C:\Program Files" should have short name C:\Progra~1 (you can verify it using DOS dir command or entering it into address bar in file explorer).

    Set your JAVA_HOME this way:

    export JAVA_HOME="/cygdrive/c/Progra~1/Java/jdk1.7.0_10"
    

提交回复
热议问题