• Fixing bad interpreter error when running Ant from Cygwin

    Do you get this error sometimes when trying to run your builds from cygwin? ant:^M /bin/sh: bad interpreter: No such file or directory I was plagued by this error from client to client and it would not always manifest itself on everyones machine. Well I finally traced it down and fixed it. The problem is two fold. The first part if you see ^M in the error then you have to fix two things.

    1. If you have the ^M in the error message. Open up $ANT_HOME/bin/ant and $ANT_HOME/bin/antRun and convert the file type to unix. I do this in vim. You can do this when you have the file open and type: :set fileformat=unix then save the file. Repeat for antRun too.
    2. The second part of the error or first if you did not have the other error. Basically when you downloaded and installed cygwin one of the base packages was missed. Run the setup.exe for cygwin and look for the Ash package.

    That is it. Any comments are welcomed.