Not sure about Java, but Scala works fine for me in cygwin after doing this[1][2]. I'd have to have a more detailed example (that I can reproduce myself) of what gets messed up though if it's something beyond that, since I can't remember anymore exactly what else I had to do offhand.