Mingw translates paths and environment variables into UNIX equivalents. It's designed to work with its own tools, and running something foreign to it, like java.exe, doesn't always work out as you'd expect. In particular, that script builds a Java classpath in the variable ES_CLASSPATH and then passes it to Java using the -cp switch, and I bet it's passing Java a path it simply doesn't understand.
What I would do is find the line that executes java.exe in that script, and make a copy of the line prepended with "echo" so that you can see the command line that's being executed. Then adjust the script to provide a proper Java classpath.