1

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

2
  • How do you exit your application? Commented May 8, 2015 at 15:24
  • just by letting the start() method return. The return value then is the exit code. Commented May 9, 2015 at 7:28

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

Comments

0

Add the following line to your IApplication.start(IApplicationContext) method before returning your exit code:

// prevent launcher messages System.setProperty(IApplicationContext.EXIT_DATA_PROPERTY, ""); return exitCode; 

And add --launcher.suppressErrors to the command you run.

Linking the useful bug on that topic: https://bugs.eclipse.org/bugs/show_bug.cgi?id=313819

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.