Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Eclipse Exit codes and JVM Terminated window
Eclipse Exit codes and JVM Terminated window [message #177686] Tue, 31 October 2006 18:06 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:Change default editor behaviour
Next Topic:Is there Eclipse for XP on AMD Turion?
Goto Forum:
  


Current Time: Fri Apr 19 20:57:56 GMT 2024

Powered by FUDForum. Page generated in 0.07453 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top