Cygwin MS-DOS style path issues

Posted on Thursday, August 15, 2013

Recently I ran across a MS-DOS style path warning when trying to run Scala for the first time in cygwin.

It looks like it's working, Here is the text of the warning.

cygwin warning:
  MS-DOS style path detected: C:\Program Files\Java\jdk1.6.0_25/bin/java
  Preferred POSIX equivalent is: /cygdrive/c/Program Files/Java/jdk1.6.0_25/bin/java
  CYGWIN environment variable option "nodosfilewarning" turns off this warning.
  Consult the user's guide for more details about POSIX paths:

Which suggest using the cygwin utility took cygpath.

In my case I have defined JAVA_HOME in my System Properties

 Cygwin is using this path

If I run the following command

> echo $JAVA_HOME

It returns the MS-DOS style path.

You can use the cygpath command to convert paths from MS-DOS style to unix style.

If you run this command you will see how it works.

> cygpath $JAVA_HOME

You can see how it converts the path.

One way to permanently fix this is to edit the .bash_profile.

Open the .bash_profile

> vi .bash_profile

And add the following to the bottom.

export JAVA_HOME=$( cygpath "JAVA_HOME" )

Opening a new Cygwin window and running scala -version results in

Problem fixed!


[1]  How can I get Cygwin to accurately read my Windows environment variables?
       Visited 1/2013

No comments:

Post a Comment