preventing exit code window [message #478948] |
Fri, 07 August 2009 11:38  |
Eclipse User |
|
|
|
If my rcp application executes System.exit(1), then the typical window
with the message "JVM terminated. Exit code=1 ..[startup parameters]"
appears. How can I prevent this window from being displayed?
As you may ask now why I use exit codes: another program starts the rcp
application and evaluates the exit code after the rcp is closed by the
user. This other program allows communication only by exit codes. The
exit code returned by the RCP depends on what the user did.
|
|
|
|
Re: preventing exit code window [message #500716 is a reply to message #480688] |
Fri, 27 November 2009 11:36  |
Eclipse User |
|
|
|
Hi,
is it possible to suppress this popup window being displayed if my
command line RCP application is NOT based on workbench ?
best regards
Dawid
Am Tue, 18 Aug 2009 17:42:23 +0900 schrieb Jiyul:
> If your application based on workbench, There is no way to override
> return code in general approach.
>
> But, System.exit() is much worse idea. It can cause a lot of data loss.
>
> So, I suggest alternative way:
>
> IWorkbench bench = PlatformUI.getWorkbench();
>
> Method closeMethod =
> bench.getClass().getDeclaredMethod("close", int.class, boolean.class);
> closeMethod.setAccessible(true);
>
> closeMethod.invoke(bench, YOUR_RETURN_CODE, true);
>
>
>
>
> Jörg Kiegeland wrote:
>> If my rcp application executes System.exit(1), then the typical window
>> with the message "JVM terminated. Exit code=1 ..[startup parameters]"
>> appears. How can I prevent this window from being displayed?
>>
>> As you may ask now why I use exit codes: another program starts the rcp
>> application and evaluates the exit code after the rcp is closed by the
>> user. This other program allows communication only by exit codes. The
>> exit code returned by the RCP depends on what the user did.
|
|
|
Powered by
FUDForum. Page generated in 0.24127 seconds