0

I own a game server and I was just wondering, instead of running the server in eclipse and then when I restart it, it opens a new cmd prompt outside of eclipse and runs the server on that. Could I make it so the program relaunches in eclipse as if I hit the green play button?

Jonathan Beaudoin
  • 2,158
  • 4
  • 27
  • 63
  • 5
    In the Debug perspective you can 'Terminate and Relaunch' a running executable. But more importantly, why are you running your app out of Eclipse in the first place? You're only supposed to do that during the development phase. – Perception Jan 14 '13 at 21:09
  • Well I host it from my house and I use jrebel which is a plugin for eclipse, I could run it from a cmd prompt but I prefer not to. I could do the terminate and relaunch but I'm looking todo something similar to that but programmatically. – Jonathan Beaudoin Jan 14 '13 at 21:15
  • 2
    JRebel is a tool to make developing faster. It has nothing to do with your end product. – Tansir1 Jan 14 '13 at 22:50

1 Answers1

1

I was reading your comments on this post. You said that you don't want to kill the program and then restart from within eclipse. So you have two options.

  1. Bad Answer: Just press ctrl + F11 (relaunch the application and ignore the old one)
  2. Good Answer: Press F11 then go to what looks like a computer in the console tab. You can select the previous running program and kill it and the second one will still be running.

If what you want to do is transfer the data and keep it the same run time state, well to say the least that is going to be some what complex. I would make some kind of method to transfer all current data and call it from your constructor. Then start your second program and kill the original. I'm 90% sure all your users will get booted though.

SpiffyDeveloper
  • 127
  • 1
  • 7
  • I don't mind if the users get booted, I want to execute a command within the game which adds a new shutdown hook which essentially runs the run configuration for the server programatically. – Jonathan Beaudoin Jan 15 '13 at 21:26