exit eclipse IPlatformRunnable with error exit code [message #330149] |
Thu, 17 July 2008 06:24  |
Eclipse User |
|
|
|
Originally posted by: kadychevski.magillem.com
Hello,
i'm trying to make eclipse application return some custom exit code (to
be used in a bash script later). basically the code is
class MyRunnable implements IPlatformRunnable {
public Object run(Object args) throws Exception {
try {
doSomeStuff();
}
catch(MyExitException e) {
return 1;
}
return IPlatformRunnable.EXIT_OK;
}
private doSomeStuff() throws MyExitException {
throw new MyExitException("something went wrong");
}
}
this is where i am after browsing through eclipse forums and api
documentation.
the problem is this solution generates a "JVM crashed window" with error
code = 1.
Do someone knows where am i wrong?
thanks,
vladimir
|
|
|
Re: exit eclipse IPlatformRunnable with error exit code [message #330159 is a reply to message #330149] |
Thu, 17 July 2008 11:31   |
Eclipse User |
|
|
|
Hey Vladimir,
This is expected behaviour in current versions of Eclipse. I think the
dialog you are seeing is not really a JVM "crashed" dialog, but more a JVM
"exited with non-zero exit status" dialog, which is exactly what
happened. The somewhat new behaviour of this dialog being shown has
recently bitten me as well, and there is more information in these bugs
about this issue and how to work around it (I am assuming you are using
Eclipse 3.4):
https://bugs.eclipse.org/bugs/show_bug.cgi?id=209080
https://bugs.eclipse.org/bugs/show_bug.cgi?id=191597
The executive summary? Try adding this line to your run method to avoid
the dialog:
System.getProperties().put("eclipse.exitdata", "");
Mark.
On Thu, 17 Jul 2008 06:24:51 -0400, Vladimir Kadychevski
<kadychevski@magillem.com> wrote:
> Hello,
>
> i'm trying to make eclipse application return some custom exit code (to
> be used in a bash script later). basically the code is
>
>
> class MyRunnable implements IPlatformRunnable {
> public Object run(Object args) throws Exception {
> try {
> doSomeStuff();
> }
> catch(MyExitException e) {
> return 1;
> }
> return IPlatformRunnable.EXIT_OK;
> }
>
> private doSomeStuff() throws MyExitException {
> throw new MyExitException("something went wrong");
> }
> }
>
> this is where i am after browsing through eclipse forums and api
> documentation.
>
> the problem is this solution generates a "JVM crashed window" with error
> code = 1.
>
> Do someone knows where am i wrong?
>
> thanks,
>
> vladimir
|
|
|
Re: exit eclipse IPlatformRunnable with error exit code [message #330168 is a reply to message #330159] |
Thu, 17 July 2008 14:32  |
Eclipse User |
|
|
|
Originally posted by: kadychevski.magillem.com
hi Mark,
thanks for your answer. Actually I'm working on eclipse 3.2.2 on linux.
if you say that this is expected behavior it's good enough for me. i'll
wrap eclipse launcher in a script or something like that.
thanks for your help,
Vladimir
Mark Melvin a écrit :
> Hey Vladimir,
>
> This is expected behaviour in current versions of Eclipse. I think the
> dialog you are seeing is not really a JVM "crashed" dialog, but more a
> JVM "exited with non-zero exit status" dialog, which is exactly what
> happened. The somewhat new behaviour of this dialog being shown has
> recently bitten me as well, and there is more information in these bugs
> about this issue and how to work around it (I am assuming you are using
> Eclipse 3.4):
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=209080
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=191597
>
> The executive summary? Try adding this line to your run method to avoid
> the dialog:
>
> System.getProperties().put("eclipse.exitdata", "");
>
> Mark.
>
>
> On Thu, 17 Jul 2008 06:24:51 -0400, Vladimir Kadychevski
> <kadychevski@magillem.com> wrote:
>
>> Hello,
>>
>> i'm trying to make eclipse application return some custom exit code (to
>> be used in a bash script later). basically the code is
>>
>>
>> class MyRunnable implements IPlatformRunnable {
>> public Object run(Object args) throws Exception {
>> try {
>> doSomeStuff();
>> }
>> catch(MyExitException e) {
>> return 1;
>> }
>> return IPlatformRunnable.EXIT_OK;
>> }
>>
>> private doSomeStuff() throws MyExitException {
>> throw new MyExitException("something went wrong");
>> }
>> }
>>
>> this is where i am after browsing through eclipse forums and api
>> documentation.
>>
>> the problem is this solution generates a "JVM crashed window" with error
>> code = 1.
>>
>> Do someone knows where am i wrong?
>>
>> thanks,
>>
>> vladimir
>
|
|
|
Powered by
FUDForum. Page generated in 0.03038 seconds