Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Native Launcher and Current/Working directory
Native Launcher and Current/Working directory [message #103862] Tue, 15 January 2008 11:25 Go to next message
Erik Vanherck is currently offline Erik VanherckFriend
Messages: 23
Registered: July 2009
Junior Member
Hi Guys,

As you all know, Java does not provide a way to set the current directory
for a JVM. It just defaults to whatever it was started with and to make
matters worse the OS can change this while the application is running (JNI
code using native windows dialogs as an example). Making the current
directory a real bitch to use.

We are still stuck on 3.2.2 for the moment but moving now to 3.3 or even
3.4 in our shipping products. Hence I was looking into all the changes
done to the launcher part.

Anyhow, in many cases you do need to know where you can resources that
were installed so we have since ages used a system property set to the
absolute path. Nasty but alas. Some others that require absolute paths are
java.endorsed.dirs

We used to have the installer patch this in the ini files but this makes
deployment harder then it needs to be. Now my question is does the new
launcher force the JVM at startup to run in the directory it is installed
or not ? In case of not I think a @PROGAMDIR would be a good variable that
the launcher could replace. I realize that @USERHOME etc are replaced in
OSGi startup code but I many system properties are only read at JVM
startup .. which for endorsed for instance is simply not possible.

Any thoughts anyone ?
Re: Native Launcher and Current/Working directory [message #103893 is a reply to message #103862] Tue, 15 January 2008 16:21 Go to previous message
Andrew Niefer is currently offline Andrew NieferFriend
Messages: 990
Registered: July 2009
Senior Member
The working directory will not be changed by the eclipse launcher and the jvm is
not forced to run it its own directory. It will be started using an absolute
path or loaded as a shared library into the eclipse process and started with the
JNI invocation API.

The launcher does not currently do variable substitution, watch
https://bugs.eclipse.org/bugs/show_bug.cgi?id=102239 if you are interested in that.

If you are shipping a vm with your product, you can consider execution
environment description files.
http://wiki.eclipse.org/Execution_Environment_Descriptions
These files can be used to start the vm with a set of arguments, and in this
file, the variable ${ee.home} is replaced with the directory containing the .ee
file.

-Andrew

Erik Vanherck wrote:
> Hi Guys,
>
> As you all know, Java does not provide a way to set the current
> directory for a JVM. It just defaults to whatever it was started with
> and to make matters worse the OS can change this while the application
> is running (JNI code using native windows dialogs as an example). Making
> the current directory a real bitch to use.
>
> We are still stuck on 3.2.2 for the moment but moving now to 3.3 or even
> 3.4 in our shipping products. Hence I was looking into all the changes
> done to the launcher part.
>
> Anyhow, in many cases you do need to know where you can resources that
> were installed so we have since ages used a system property set to the
> absolute path. Nasty but alas. Some others that require absolute paths
> are java.endorsed.dirs
>
> We used to have the installer patch this in the ini files but this makes
> deployment harder then it needs to be. Now my question is does the new
> launcher force the JVM at startup to run in the directory it is
> installed or not ? In case of not I think a @PROGAMDIR would be a good
> variable that the launcher could replace. I realize that @USERHOME etc
> are replaced in OSGi startup code but I many system properties are only
> read at JVM startup .. which for endorsed for instance is simply not
> possible.
>
> Any thoughts anyone ?
>
Previous Topic:Equinox Transforms
Next Topic:Nullpointerexception in initializeStorage
Goto Forum:
  


Current Time: Sun Dec 21 18:50:46 GMT 2014

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

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