fix NPE
run java command on slave if OS is different than master's OS