This one is easy to fix. Give it a script that both kills the old process and starts the new one. Then it can't forget. This is what I do; categorically solved the problem.
Ideally the build tool does that for you, e.g. `./gradlew run -t`.