Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Kill External Program Launched by Eclipse
Kill External Program Launched by Eclipse [message #939923] Thu, 11 October 2012 06:33 Go to next message
Deepak P is currently offline Deepak P
Messages: 20
Registered: January 2012
Junior Member
Using the Eclipse articles
1) "http://eclipse.org/articles/Article-Launch-Framework/launch.html" and
2) "http://eclipse.org/articles/Article-Java-launch/launching-java.html" am able to launch an external program easily.

But my question is, are there any means of terminating or killing the launched external program using eclipse ...??

Thanks in advance

Regards,
Deepak P
Re: Kill External Program Launched by Eclipse [message #940660 is a reply to message #939923] Thu, 11 October 2012 21:28 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin Dahyabhai
Messages: 2310
Registered: July 2009
Senior Member
It should be visible from the Debug view. You can use the toolbar buttons or context menu to Terminate a selected process.

http://help.eclipse.org/juno/topic/org.eclipse.jdt.doc.user/reference/views/debug/images/ref-debug_view.PNG


---
Nitin Dahyabhai
Eclipse WTP, IBM

[Updated on: Thu, 11 October 2012 21:28]

Report message to a moderator

Re: Kill External Program Launched by Eclipse [message #940945 is a reply to message #940660] Fri, 12 October 2012 04:44 Go to previous messageGo to next message
Deepak P is currently offline Deepak P
Messages: 20
Registered: January 2012
Junior Member
Hi Nitin,
Thanks for the reply.

Let me say what i am trying to do in detail.

Basically I am developing an RCP. In that RCP I am trying to start an external program on a click of a button, say Button "Launch My External Program".

And there is another button say "Terminate My External Program". On the click of this button the external program that had been launched using the "Launch My External Program" button needs to be terminated.

And in the RCP the "Debug" View provided by the Eclipse is not included.
Thus the launch and termination needs to be done via the customized buttons/commands.

If you have a solution, please let me know


Regards,
Deepak
Re: Kill External Program Launched by Eclipse [message #945244 is a reply to message #940945] Mon, 15 October 2012 10:05 Go to previous message
Deepak P is currently offline Deepak P
Messages: 20
Registered: January 2012
Junior Member
Found a workaround to terminate the externally launched program.

The below code launches the external program.

ILaunchConfiguration configuration = launchConfigurationWorkingCopy.doSave();

configuration.launch(ILaunchManager.RUN_MODE, new NullProgressMonitor());

Once this is done,
configuration.launch() API returns ILaunch.
ILaunch has an API as shown below.

launch.terminate()

By executing the above line, the corresponding externally started program can be terminated.

Regards,
Deepak P
Previous Topic:Ran into a JDK error
Next Topic:Binary To Decimal
Goto Forum:
  


Current Time: Sun Oct 26 00:19:39 GMT 2014

Powered by FUDForum. Page generated in 0.04153 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software