export JAVA_HOME with spaces in Cygwin

后端 未结 7 912
失恋的感觉
失恋的感觉 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:27

    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:"
    

提交回复
热议问题