Configure executable and encoding

In our projects we need to provide a Java executable which might not be the one which spawned the buildscript.  Also, we need to not rely on platform encoding.  This patch cover this.