Search code examples
javaeclipseexit-code

Eclipse Java application: Returning exit code \= 0 opens unwanted window


We're building an application in Java based on Eclipse. Its entry point implements IApplication. The exit code is set by method start().

The problem is that if the exit code is not 0, Eclipse presents a dialog box saying "Java was started but returned exit code=...". After the user closes the dialog, the application terminates and the exit code is correctly set.

How can I prevent the warning dialog from being displayed?

Thanks, Ulrich

Windows 8.1

org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar


Solution

  • If you add this:

    --launcher.suppressErrors

    to your eclipse.ini file, it should prevent the dialog to be shown.

    If you don't want the message to appear on your stderr as well, you should set the system variable "eclipse.exitdata" to empty. That will prevent any message to be written, either on stderr or on the dialog.