Community
Participate
Working Groups
Build Identifier: Eclipse 3.6 20100506-2000 IN silent mode the launcher of Eclipse 3.6 (M7) incorrectly prints out all the command line arguments passed to the Java code. This happens despite the fact that the --launcher.suppressErrors was used. This is a regression from previous version of Eclipse launchers and causes serious troubles with the command line operation for Eclipse RCP application. The output is confusing for normal user. This output is definitely useful for debug purposes but there must be a way to disable it. Reproducible: Always Steps to Reproduce: 1.Download and unzip to some directory the windows (on windows) version of Eclipse 3.6 M7. 2.In the unzipped eclipse directory create a file named “exec.bat” with the following simple content: “exit 1” 3. Add to the eclipse.ini file the fooling lines: -nosplash --launcher.suppressErrors -silent -vm exec.bat The goal above is to simulate silent mode where java process returns an error (non 0) value. Please note that the --launcher.suppressErrors is used. 4. Open a DOS prompt in this directory and execute: eclipsec The output will look like this: C:\recv\eclipse-java-helios-M7-win32\eclipse>eclipsec C:\recv\eclipse-java-helios-M7-win32\eclipse>exit 1 Eclipsec: Java was started but returned exit code=1 C:\recv\eclipse-java-helios-M7-win32\eclipse\exec.bat -Dosgi.requiredJavaVersion=1.5 -Xms40m -Xmx384m -jar C:\recv\eclipse-java-helios-M7-win32\eclipse\plugins/org.eclipse.equinox.la uncher_1.1.0.v20100419.jar -os win32 -ws win32 -arch x86 -launcher C:\recv\eclipse-java-helios-M7-win32\eclipse\eclipsec.exe -name Eclipsec --launcher.library C:\recv\eclipse-java-helios-M7-win32\eclipse\plugins/org.ecli pse.equinox.launcher.win32.win32.x86_1.1.0.v20100322-1720\eclipse_1307.dll -startup C:\recv\eclipse-java-helios-M7-win32\eclipse\plugins/org.eclipse.equino x.launcher_1.1.0.v20100419.jar -exitdata 1840_7bc -product org.eclipse.epp.package.java.product -silent -vm C:\recv\eclipse-java-helios-M7-win32\eclipse\exec.bat -vmargs -Dosgi.requiredJavaVersion=1.5 -Xms40m -Xmx384m -jar C:\recv\eclipse-java-helios-M7-win32\eclipse\plugins/org.eclipse.equinox.la uncher_1.1.0.v20100419.jar C:\recv\eclipse-java-helios-M7-win32\eclipse> This problem is reproducible on other platforms (as Linux) as well.
"-silent" is not an argument supported by the eclipse launcher. This appears to be working as designed, however there was a bug in 3.5 and earlier that prevented the error message from being displayed when the vm failed early. This was fixed in 3.6 so we do see a change in behaviour. See bug 209080 comment #21 for the intent of "--launcher.suppressErrors". The intent is to write the error to stderr instead of displaying the dialog. An eclipse application can turn off the error messages completely by setting an empty message in the "eclipse.exitdata" java system property. This requires the vm to have started successfuly. Bug 291919 comment #4 found the problem where a vm failure before getting to Main always looks like the exit message was turned off. The result of this was that the error message was not displayed when it should have been. There was no designed method to completely turn off the error message when we can't even launch the vm.
Vlad, we can either mark this as invalid or reclassify as an enhancement to add the support you are looking for.
Our problem is that our rcp application has a growing support for command line operation. The application does print a couple of lines with error messages, but they are almost lost (unnoticeable) when followed by the output listed above. I'd guess that this is be a major problem for any RCP application running in command line mode. Could you recommend any approach allowing us to disable this output assuming the JRE and the RCP application are executed successfully but the RCP application is returning a non zero code? If there is no workaround, please reclassify this as an enhancement request.
(In reply to comment #3) > Could you recommend any approach allowing us to disable this output assuming > the JRE and the RCP application are executed successfully but the RCP > application is returning a non zero code? > 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; In 3.6 we added a new constant for "eclipse.exitdata" which provided javadoc describing what the empty string value is used for: To suppress all error dialogs displayed by the launcher this property can be set to the empty String. This is useful for headless applications where error dialogs must never be displayed.
Thank you Thomas! This work around can and will be used in our case. So this bug may be closed. Maybe there still could be a special command line argument (something like "--launcher.suppressCommandLineErrors") dedicated to this. But at this point that would be a low priority enhancement request.
(In reply to comment #5) > Thank you Thomas! > > This work around can and will be used in our case. > So this bug may be closed. > > Maybe there still could be a special command line argument (something like > "--launcher.suppressCommandLineErrors") dedicated to this. But at this point > that would be a low priority enhancement request. In retrospect --launcher.suppressErrors likely should have been called --launcher.suppressErrorDialogs and the option --launcher.suppressErrors should have been used for disabling all errors (dialogs or console prints etc.) An option like --launcher.suppressCommandLineErrors is confusing IMO when compared with the current option --launcher.suppressErrors. Another option is to allow --launcher.suppressErrors to accept an argument dialog - suppress error dialogs, but print to console. all - suppress all error indicators Default value would be "dialog".
--launcher.silent is also nice. This kind of reminds me of how some *nix commands have both "quiet" and "really quiet" options.