Eclipse Exit codes and JVM Terminated window [message #177686] |
Tue, 31 October 2006 18:06 |
Eclipse User |
|
|
|
Originally posted by: kirby.bohling.gmail.com
I'd like to write an Eclipse application that does JUnit testing, as
such, I'd really like to have control of the exit code so the automated
tool can change behavior based on failures/errors. But I'd like to
avoid having the silly JVM Terminated window come up.
I wrote a class that implements IPlatformRunnable that I use to control
the application, and I return 0, 1 and 2 similar to the way Eclipse does
in org.eclipse.test. However that doesn't appear to behaving sanely.
Oddly, it appears that the System exit code is not being set (because
Ant isn't noticing the failure, and when I run it at the command line
the error code is "0").
Is there any safe way to modify the record code returned to the OS? Is
there anyway to avoid having the "JVM Terminated" error screen come up,
as I'd like to run the application in a totally unattended mode.
Thanks,
Kirby
|
|
|
Re: Eclipse Exit codes and JVM Terminated window [message #177720 is a reply to message #177686] |
Tue, 31 October 2006 19:45 |
Eclipse User |
|
|
|
Originally posted by: kirby.bohling.gmail.com
Kirby C. Bohling wrote:
> I'd like to write an Eclipse application that does JUnit testing, as
> such, I'd really like to have control of the exit code so the automated
> tool can change behavior based on failures/errors. But I'd like to
> avoid having the silly JVM Terminated window come up.
>
> I wrote a class that implements IPlatformRunnable that I use to control
> the application, and I return 0, 1 and 2 similar to the way Eclipse does
> in org.eclipse.test. However that doesn't appear to behaving sanely.
>
> Oddly, it appears that the System exit code is not being set (because
> Ant isn't noticing the failure, and when I run it at the command line
> the error code is "0").
>
> Is there any safe way to modify the record code returned to the OS? Is
> there anyway to avoid having the "JVM Terminated" error screen come up,
> as I'd like to run the application in a totally unattended mode.
>
> Thanks,
> Kirby
Well, I don't like to respond to my own questions, but for posterity in
case anyone finds it in a search, I did figure it out:
Run java from the command line directly, rather then invoking the
application itself (I was running "run-tests.exe"). Doing something
like this:
java -cp "%ECLIPSE32_HOME%\startup.jar" org.eclipse.core.launcher.Main
-application <application-here> -install <path-to-app>
And I no longer get the JVM Terminated issue, and the proper error code
is returned.
Thanks,
Kirby
|
|
|
Powered by
FUDForum. Page generated in 0.07453 seconds