• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to restart my application  RSS feed

 
seetharaman jayaraman
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i need some help for restarting my java application from the code itself. i.e. some thing like logoff, switch user, etc
System.exit(), exits the application
thanks
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
seetharaman jayaraman wrote:i need some help for restarting my java application from the code itself
System.exit(), exits the application


System.exit shutdown the JVM. it wont restart
 
seetharaman jayaraman
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
seetharaman venkatasamy wrote:
seetharaman jayaraman wrote:i need some help for restarting my java application from the code itself
System.exit(), exits the application


System.exit shutdown the JVM. it wont restart


Dear venkatasamy, we both tell the same thing. System.exit() exits the application. hahaha. please. go through my message. If anybody know how to restart the application from code itself, please help.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't understand what you're trying to do. If the application shouldn't quit, then don't call System.exit. Instead, change the GUI so that a different user can log in.

Once the application has quit (meaning the JVM doesn't run any more), there's nothing the no-longer-running code can do about that.
 
Benny Mueller
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What about starting a second instance of your application immediately befor terminating the first one?

Just an idea

 
seetharaman jayaraman
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Benny Mueller wrote:What about starting a second instance of your application immediately befor terminating the first one?

Just an idea



Yes, Benny Mueller,

I can start another instance, but now 2 instances are there. I don't know how to kill the first instance.
 
Uli Hofstoetter
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't kill the application.

Rethink your design, cleanup all user specific data or stuff like that and then go back to the login screen.

Everything else would probably be some strange and unreliable workaround.

Just my 2cent
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!