How to restart the application from itself

I create a batch file with a new VM-Param:

java -Xmx256m app.jar

if there is not enought memory.

Is there any possibility to shut down the running app.jar, like System.exit(0) and execute this batch file, so that the user won't care about it and don't have to do it manually?

Like Firefox restart itself after upgrade.

Thanks in advance.

[376 byte] By [flexeda] at [2007-11-27 4:19:10]
# 1
make a small app that gets called just before the app is stopped which waits.. 5 seconds and starts the app?using System.exec ?
mkoryaka at 2007-7-12 9:26:05 > top of Java-index,Java Essentials,Java Programming...
# 2
or just use firefox =)
mkoryaka at 2007-7-12 9:26:05 > top of Java-index,Java Essentials,Java Programming...
# 3
Hello mkoryak,thank you for you answer.Should I define it in a batch file, or it should be small another app.jar?Do you have any samples?
flexeda at 2007-7-12 9:26:05 > top of Java-index,Java Essentials,Java Programming...