Just went through the code again and I'm now tending to agree with your implementation as probably the sanest way to address the problem.

Is it safe to use a relative command name (e.g. `keytool`) rather than a fully-qualified executable path such as what `command` would return (e.g. `/usr/bin/keytool`)?