Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Equinox Launcher and LD_LIBRARY_PATH
Equinox Launcher and LD_LIBRARY_PATH [message #1060069] Wed, 22 May 2013 20:42 Go to next message
Kaloyan Raev is currently offline Kaloyan RaevFriend
Messages: 201
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
I am looking for a way to configure the Equinox Launcher in a way that it starts Eclipse with modified value of the $LD_LIBRARY_PATH environment variable.

Is this possible?

The background is that we have Eclipse-based product that is heavily hit by issues with the WebKit on 64-bit Linux, e.g. [1], [2] and [3]. Latest Ubuntu distros have WebKitGTK 1.10.2 installed, which is not well supported by SWT and causes Eclipse to crash. A possible workaround is to downgrade the installed WebKitGTK to 1.8.3.

I am exploring the opportunity to bundle a validated version of WebKitGTK with our Eclipse product, so users are not required to apply any non-intuitive workarounds. According to the SWT FAQ [4] the WebKitGTK library must be in the load library path. On Linux it is possible to modify the load library path using the $LD_LIBRARY_PATH environment variable. I was able to successfully test this approach by setting $LD_LIBRARY_PATH before launching Eclipse. Now I am looking for a way how to tell the Equinox Launcher to load Eclipse with modified value of $LD_LIBRARY_PATH.

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=392967
[2] https://bugs.eclipse.org/bugs/show_bug.cgi?id=404776
[3] https://bugs.eclipse.org/bugs/show_bug.cgi?id=400626
[4] http://www.eclipse.org/swt/faq.php#browserwebkitgtk
Re: Equinox Launcher and LD_LIBRARY_PATH [message #1060152 is a reply to message #1060069] Thu, 23 May 2013 10:49 Go to previous messageGo to next message
Pascal Rapicault is currently offline Pascal RapicaultFriend
Messages: 333
Registered: July 2009
Location: Ottawa
Senior Member
The library path can not be changed once the process has been started (I looked at the linux code for that last summer).

So you have a couple solutions:
- start your app with the eclipse launcher (the executable) and store your library next to it
- have a bundle that loads the library before it is needed using Runtime#load(). This should work since the library will then be loaded by the time it is actually necessary

Re: Equinox Launcher and LD_LIBRARY_PATH [message #1060172 is a reply to message #1060152] Thu, 23 May 2013 11:51 Go to previous message
Kaloyan Raev is currently offline Kaloyan RaevFriend
Messages: 201
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Pascal, you rock! (as always)

Your second suggestion leads to a very elegant solution. I can define a BrowserInitializer class (as suggested in the SWT FAQ [1]), that is called before SWT creates the first instance of a browser, and load my own version of WebKitGTK in its static initializer using Runtime.load().

However, I'd like to explore also your first suggestion, which I didn't understand very well. My Eclipse-based product is indeed started using the Eclipse launcher - the executable. What do you mean by "store your library next to it"? I copied my library in the root folder (where the launcher executable is) of my product, but this didn't help loading my library instead of the one installed in the OS.

[1] http://www.eclipse.org/swt/faq.php#browserspecifydefault
Previous Topic:services console command filter problem
Next Topic:How to create an Application/Product from OSGi Framework Run Configuration?
Goto Forum:
  


Current Time: Thu Apr 25 10:56:57 GMT 2024

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

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

Back to the top