Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » equinox launcher and environment variables
equinox launcher and environment variables [message #653829] Fri, 11 February 2011 13:10 Go to next message
Thomas is currently offline ThomasFriend
Messages: 151
Registered: July 2009
Senior Member
Hi all,

I would like to set various environment vars (e.g. Path/LD_LIBRARY_APTH)
during startup of my rcp application. What I did so far to achieve this,
without needing to add a batch/shell script, is to extend the
org.eclipse.equinox.launcher bundle. I added my own CustomMain class and
changed the Manifest to point to this class. Furthermore, the CustomMain
extends org.eclipse.equinox.launcher.Main and overrides the run(String[]
args) method. In that method I set my environment vars using JNA. This seems
to work, cause if I call System.getenv() in one of my RCP bundles, the vars
are set.

So far so good. Unfortunately, my native libs, which I want to call via JNI
and that are referenced by the env vars, can still not be resolved in my
application. I thought, that the launcher Main starts the VM via JNI and
passes all the env vars that are present at this point in time. Any ideas?
What am I missing?

Regards,
Thomas.
Re: equinox launcher and environment variables [message #653909 is a reply to message #653829] Fri, 11 February 2011 20:00 Go to previous message
Gunnar Wagenknecht is currently offline Gunnar WagenknechtFriend
Messages: 486
Registered: July 2009
Location: San Francisco ✈ Germany
Senior Member

Am 11.02.2011 14:10, schrieb Thomas:
> What am I missing?

At the time any Java code is executed, the JVM has already been started
by the native part of the Equinox launcher. That happens in the
"eclipse[.exe]" binary.

However, the JVM does look at the 'java.library.path' system property
when looking for DLLs. Thus, you could try starting Eclipse with
"eclipse -vmargs -Djava.library.path=...".

-Gunnar

--
Gunnar Wagenknecht
gunnar@wagenknecht.org
http://wagenknecht.org/
Previous Topic:Strange p2 update issue
Next Topic:p2 dropins - advised or not advised?
Goto Forum:
  


Current Time: Thu Apr 18 14:33:05 GMT 2024

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

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

Back to the top