FIX #405: Script replacements doesn't work with jdeb packaging

We can use this as windows will not work as chmod is used.
You have to implement the subset of this function yourself ( in Java 7 we can remove
a lot of this clunky code )