Avoid passing java to scalar as it isn't yet entirely up to scratch on jdk8