cacert
cacert

Reputation: 2797

Eclipse process launch

How can I get the process of a launched java application inside of a plugin? I am using:

DebugUITools.launch();  

to launch the application. I have tried to use:

IProcess cur = DebugUITools.getCurrentProcess(); 

but it returns null at the beginning of the application launch.

Actually, my aim is to read from the console of the running application and by having the current process I tried to call:

DebugUITools.getConsole(IProcess process); 

which returns the console. The Q now is how to read from this console programmatically.

Upvotes: 2

Views: 677

Answers (1)

Ernest Friedman-Hill
Ernest Friedman-Hill

Reputation: 81684

Instead of calling launch(), call buildAndLaunch(), which gives you the ILaunch back. You can ask the ILaunch for IProcess objects.

Upvotes: 3

Related Questions