Use exec to preserve java pid.