سؤال

Using Eclipse, I'm launching an external program through an "External Tool Configuration".

My program has a "bin/launch-program" executable, but also a "bin/stop-program" which is the only way to stop the program.

In my Eclipse's External Tool Configuration, tab "Main", I set:

  • Location: <PROGRAM_HOME>/bin/launch-program
  • Working Directory: <PROGRAM_HOME>

But I'm looking a way to handle the stop event.

In other words, launching an external program works well: I get the output in the Eclipse's console. The question is: how to handle the click on the Terminate button of the console, to launch a specific command line?

هل كانت مفيدة؟

المحلول

terminating the program from the terminate button of the eclipse console is equivalent to kill it by using a task manager. It's not safe to edit the command on the red terminate button, but you can make the program to do things before exiting shutdown hook

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top