Write startup/shutdown commands from java