private void initializeTasklet() { tasklet = new SystemCommandTasklet(); tasklet.setEnvironmentParams(null); // inherit from parent process tasklet.setWorkingDirectory(null); // inherit from parent process tasklet.setSystemProcessExitCodeMapper(new SimpleSystemProcessExitCodeMapper()); tasklet.setTimeout(5000); // long enough timeout tasklet.setTerminationCheckInterval(500); tasklet.setCommand("invalid command, change value for successful execution"); tasklet.setInterruptOnCancel(true); tasklet.setTaskExecutor(new SimpleAsyncTaskExecutor()); }