Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Eclipse run a single instance only of a project?

Tags:

java

eclipse

I usually develop mobile apps for iOS and Android and I am used to launching projects repeatedly without asking if another instance is running or not, since the simulators will handle this for me.

When I use Eclipse to develop desktop apps, I face this problem since running multiple times the same project will result in multiple different instances. I would like Eclipse to be able to kill the previously-opened processes before running the new one. I've found this question, but this one addresses the problem to let a single instance of a Java application run, but this is not quite the point. I do not care if the final release will run one or two times, I just want to be able to run a single instance when developing, seamlessly like Xcode or Eclipse for Android do. Moreover, that solution will popup an alert when running the same project twice, but that's not a solution for me. Kill and run, that it.

Is it possible to change the run configuration of the project to achieve this without changing the source code, or is this achievable with a plugin or whatelse? I would like to find a completely automated solution that could make me work as if I were under Xcode.

like image 347
marzapower Avatar asked May 31 '13 14:05

marzapower


2 Answers

No, it is not possible to change the Eclipse run configuration so that Eclipse stops existing instance before running new instance.

As an alternative, you might try setting a keyboard shortcut for "Terminate" action.

  • What is the short cut in eclipse to terminate debugging/running?
  • Is there a keyboard shortcut for stopping the current console in Eclipse?
like image 135
kaliatech Avatar answered Sep 30 '22 02:09

kaliatech


As a general solution to this, try:

Goto Window->Preferences, search for Launching.

Select the "Terminate and Relaunch while launching" option.

Press Apply.

Not sure if it would work while developing Android (not very common in Eclipse now), but good option to know.

like image 42
dac2009 Avatar answered Sep 30 '22 01:09

dac2009