launching another Java app from within an RCP app [message #449769] |
Thu, 18 May 2006 19:00  |
Eclipse User |
|
|
|
Originally posted by: subscriber.pikesoft.com
I have a requirement to launch a second Java app from within my RCP app.
I've tried two sort of standard ways of doing this and neither is
satisfactory:
* If I call the second applications main() method and then the user closes
that application it crashes the RCP app, too (presumably since they run in
the same process)
* If I use Runtime.getRuntime().exec(java blahBlahBlah) I lose the ability
to close the second application programmatically from within the RCP app,
which is a requirement.
What I'd like is to do what the JDT does where you can both launch and exit
an application from RCP, but I don't want to include the JDT as a plugin and
have all the launch configuration stuff contributed to my RCP app. I've
been rooting around in the Eclipse source code for a while but haven't been
able to figure out how this is accomplished. Can anyone offer a suggestion
or point me in the right direction?
TIA!
--
David Beers
Pikesoft Mobile Computing
www.pikesoft.com
|
|
|
|
Re: launching another Java app from within an RCP app [message #449787 is a reply to message #449769] |
Fri, 19 May 2006 08:34  |
Eclipse User |
|
|
|
David Beers wrote:
> I have a requirement to launch a second Java app from within my RCP app.
> I've tried two sort of standard ways of doing this and neither is
> satisfactory:
>
> * If I call the second applications main() method and then the user closes
> that application it crashes the RCP app, too (presumably since they run in
> the same process)
>
> * If I use Runtime.getRuntime().exec(java blahBlahBlah) I lose the ability
> to close the second application programmatically from within the RCP app,
> which is a requirement.
>
> What I'd like is to do what the JDT does where you can both launch and exit
> an application from RCP, but I don't want to include the JDT as a plugin and
> have all the launch configuration stuff contributed to my RCP app. I've
> been rooting around in the Eclipse source code for a while but haven't been
> able to figure out how this is accomplished. Can anyone offer a suggestion
> or point me in the right direction?
>
> TIA!
>
Actually, at least one way that JDT launches java is to use
Runtime#exec() and then kill the Process like this (from RuntimeProcess
in org.eclipse.debug.core):
Process process = getSystemProcess();
if (process != null) {
process.destroy();
}
I've also followed up to JDT, which controls the launch configurations.
Later,
PW
|
|
|
Powered by
FUDForum. Page generated in 0.03385 seconds