Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » RCP/Equinox Console App Launcher on Linux
RCP/Equinox Console App Launcher on Linux [message #96580] Wed, 05 September 2007 09:38 Go to next message
seppi is currently offline seppiFriend
Messages: 2
Registered: July 2009
Junior Member
Hi,

how can I run the eclipse launcher (within an exported rpc product of eclipse 3.3) on a linux system without gtk/window management (its just a console application)?
The application offers an input stream, so with the -console option it gets confused with the input stream of the interactive osgi interface.

One problem is also, when an osgi/rcp error occurs, the platform wants to pop-up a message dialog: without window-management the java-vm crashes.

Is there maybe a eclipsec.exe equivalent for linux?

Thanks in advance, Stefan
Re: RCP/Equinox Console App Launcher on Linux [message #96598 is a reply to message #96580] Wed, 05 September 2007 10:09 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alex_blewitt.yahoo.com

I seem to recall that there's an enhancement request to do that. However, you can launch java -jar plugins/org.eclipse.launcher.jar or some such instead of eclipse to bring it up without the UI. All the launcher executable does is create a VM and dialog window for splash screens etc. that you can run with the java -jar without needing (though you might need to have -noSplash as well).

Alex.
Re: RCP/Equinox Console App Launcher on Linux [message #96612 is a reply to message #96598] Wed, 05 September 2007 10:35 Go to previous messageGo to next message
seppi is currently offline seppiFriend
Messages: 2
Registered: July 2009
Junior Member
For just running the pure application java -jar plugins/org.eclipse.equinox.launcher_XY.jar works fine.
For osgi troubleshooting i have the log files or may can use the -console telnet-port option to avoid stream confusion

thanks
Re: RCP/Equinox Console App Launcher on Linux [message #96642 is a reply to message #96580] Wed, 05 September 2007 18:41 Go to previous messageGo to next message
Andrew Niefer is currently offline Andrew NieferFriend
Messages: 990
Registered: July 2009
Senior Member
There is an option "--launcher.suppressErrors" that turns off the error
messages, however the launcher is statically linked against the gtk libraries so
they are required on the machine even if no graphics are being done.

See https://bugs.eclipse.org/bugs/show_bug.cgi?id=201414

-Andrew

Stefan wrote:
> Hi,
>
> how can I run the eclipse launcher (within an exported rpc product of eclipse 3.3) on a linux system without gtk/window management (its just a console application)?
> The application offers an input stream, so with the -console option it gets confused with the input stream of the interactive osgi interface.
>
> One problem is also, when an osgi/rcp error occurs, the platform wants to pop-up a message dialog: without window-management the java-vm crashes.
>
> Is there maybe a eclipsec.exe equivalent for linux?
>
> Thanks in advance, Stefan
Re: RCP/Equinox Console App Launcher on Linux [message #96657 is a reply to message #96642] Thu, 06 September 2007 06:46 Go to previous messageGo to next message
Stephan is currently offline StephanFriend
Messages: 14
Registered: July 2009
Junior Member
We use IApplication and .product to implement our server applications. The Linux/Solaris servers of our customers usually don't have any WS and we have no possibility to install them.<br/><br/>Currently, we live with the following workarounds<ul><li>we have a post-product-export-script that changes the file structure (because it is different without launcher)</li>
<li>we manually copy the launcher.ini settings into a manually coded start script (and hopefully don't forget it if we change the launcher settings in the .product)</li>
<li>we manually code the restart logic in the start script (hopefully, the exit codes will never change)</li></ul>
<br/>Not all too complicated but also not as straightforwarded as it could be (at least in my vision ;o)). Any plans when this launcher (with updated product export) could be available?

Cheers, Stephan
Re: RCP/Equinox Console App Launcher on Linux [message #96687 is a reply to message #96657] Thu, 06 September 2007 14:39 Go to previous messageGo to next message
Andrew Niefer is currently offline Andrew NieferFriend
Messages: 990
Registered: July 2009
Senior Member
Stephan Sigrist wrote:
> Any plans when this launcher (with updated product export) could be available?
>
> Cheers, Stephan

I haven't actually started working on it yet, but it is conceivable that it
could be in M3
( http://www.eclipse.org/eclipse/development/eclipse_project_p lan_3_4.html)

No promises yet though :)

-Andrew
Re: RCP/Equinox Console App Launcher on Linux [message #97079 is a reply to message #96580] Tue, 11 September 2007 15:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: christian.wagner.diligent-it.com

Hi all,

we have our application installed on a unix operating system without any window system (gtk/motif) and start it by calling "java -jar org.eclipse.osgi_3.3.0.v20070530.jar". This works fine.

On certain conditions (e.g. after an update), the application should be restarted and therefore we return IApplication.EXIT_RESTART in the start method's implementation of IApplication. IApplication.EXIT_RESTART would be Integer(23) and the idea would be to check for this exit code in the starter script and restart the application. However, the JVM always exits with exit code 0.

Browsing through the EclipseStarter class one can see that the main class does not set any exit code (unlike e.g. the main of org.eclipse.equinox.launcher.Main).

My question now is how - if at all - it is possible to retreive an exit code other than 0 by starting an application with "java -jar org.eclipse.osgi_3.3.0.v20070530.jar". Or does the exit code in this case have to be set programmatically?

Cheers,
Christian
Re: RCP/Equinox Console App Launcher on Linux [message #97177 is a reply to message #97079] Wed, 12 September 2007 08:51 Go to previous messageGo to next message
Stephan is currently offline StephanFriend
Messages: 14
Registered: July 2009
Junior Member
The problem is, that the exit code is passed around via SystemProperty "eclipse.exitcode" (see org.eclipse.equinox.internal.app.EclipseAppHandle.run() and org.eclipse.equinox.launcher.Main.run() (BTW, contain duplicate constants for "eclipse.exitcode"!)). If the application is started via -jar osgi.jar, it looks like the exit code is not handled and thus is not available to the shell script.

A workaround is to write a simple wrapper around EclipseStarter and start this one instead of -jar osgi.jar.
import org.eclipse.core.runtime.adaptor.EclipseStarter;
public class Main {
	public static void main(String[] args) {
		String exitCode = "-1";
		
		try {
			EclipseStarter.run(args, null);
			exitCode = System.getProperty("eclipse.exitcode"); //$NON-NLS-1$
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		System.exit(Integer.parseInt(exitCode));
	}
}

This solution works for us but we don't feel too comfortable with it (using internal system properties). We are not sure if there is a better approach that we have missed...

A launcher without dependency on WS would help a lot :o)

Cheers, Stephan
Re: RCP/Equinox Console App Launcher on Linux [message #97353 is a reply to message #97177] Thu, 13 September 2007 17:11 Go to previous messageGo to next message
Andrew Niefer is currently offline Andrew NieferFriend
Messages: 990
Registered: July 2009
Senior Member
Please find launcher binaries attached to
https://bugs.eclipse.org/bugs/show_bug.cgi?id=201414.

They are capable of running both with and without a WS present. More testing is
required before releasing these changes, I would appreciate people giving them a
try in both a normal eclipse and a headless app.

-Andrew

Stephan Sigrist wrote:
> The problem is, that the exit code is passed around via SystemProperty "eclipse.exitcode" (see org.eclipse.equinox.internal.app.EclipseAppHandle.run() and org.eclipse.equinox.launcher.Main.run() (BTW, contain duplicate constants for "eclipse.exitcode"!)). If the application is started via -jar osgi.jar, it looks like the exit code is not handled and thus is not available to the shell script.
>
> A workaround is to write a simple wrapper around EclipseStarter and start this one instead of -jar osgi.jar.
>
> import org.eclipse.core.runtime.adaptor.EclipseStarter;
> public class Main {
> 	public static void main(String[] args) {
> 		String exitCode = "-1";
> 		
> 		try {
> 			EclipseStarter.run(args, null);
> 			exitCode = System.getProperty("eclipse.exitcode"); //$NON-NLS-1$
> 		} catch (Exception e) {
> 			e.printStackTrace();
> 		}
> 		
> 		System.exit(Integer.parseInt(exitCode));
> 	}
> }

> This solution works for us but we don't feel too comfortable with it (using internal system properties). We are not sure if there is a better approach that we have missed...
>
> A launcher without dependency on WS would help a lot :o)
>
> Cheers, Stephan
Re: RCP/Equinox Console App Launcher on Linux [message #771859 is a reply to message #96580] Wed, 28 December 2011 11:17 Go to previous message
????? ??????? Missing name is currently offline ????? ??????? Missing nameFriend
Messages: 2
Registered: March 2011
Junior Member
seppi wrote on Wed, 05 September 2007 05:38
Hi,

how can I run the eclipse launcher (within an exported rpc product of eclipse 3.3) on a linux system without gtk/window management (its just a console application)?
The application offers an input stream, so with the -console option it gets confused with the input stream of the interactive osgi interface.

One problem is also, when an osgi/rcp error occurs, the platform wants to pop-up a message dialog: without window-management the java-vm crashes.

Is there maybe a eclipsec.exe equivalent for linux?

Thanks in advance, Stefan


I am faced with the same problem. I want to create a console application and run it in terminal. It is necessary to parse command line parameter with in the application too. What could I do?
Previous Topic:question about reading from serial port
Next Topic:P2: Headless update: Multiple P2 repos
Goto Forum:
  


Current Time: Thu Mar 28 16:01:39 GMT 2024

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

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

Back to the top