Cygwin and Java

前端 未结 5 1613
故里飘歌
故里飘歌 2020-12-17 04:50

I am new to Cygwin. What are the normal steps that are followed when setting Java classpath and all for running programs in Cygwin?

5条回答
  •  感情败类
    2020-12-17 05:44

    1) Install JDK and check the installation path

    Java binaries may be under "Program Files" or "Program Files (x86)": those white spaces will likely affect the behaviour.

    2) Preliminary info

    In order to set up env variables correctly, I suggest gathering some info before starting: - Open DOS shell (type cmd into 'RUN' box) - go to C: - type "dir /x" and take note of DOS names (with ~) for "Program Files *" folders

    3) Cygwin configuration:

    • go under C:\cygwin\home\
    • open .bash_profile and add the following two lines (conveniently customized in order to match you actual JDK path)
    export JAVA_HOME="/cygdrive/c/PROGRA~1/Java/jdk1.8.0_65"
    export PATH="$JAVA_HOME/bin:$PATH"
    

    Now from Cygwin launch

    javac -version
    

    to check if the configuration is successful.

提交回复
热议问题