Can Eclipse launcher ini -configuration variable take a relative path?

℡╲_俬逩灬. 提交于 2019-12-08 03:36:46

问题


I have an RCP Eclipse product that defines the -configuration folder to be in a different location from the exe and ini files. When I specify the path to configuration in the ini as relative to the exe, launching the product only works when launched from the directory of the exe.

Ie: /home/Sheldon>product.exe

Launching from another directory fails, unless the configuration path is set to an absolute path in the ini file.

Ie: >/home/Sheldon/product.exe

This is not the case for the startup or launcher.library variables.

Is there a way to support this setup with a relative configuration path?


回答1:


I rarely like to close my own question without a comment or an anwser, but I did come to a conclusion and I think it is the best answer at this time.

I do not believe this is possible, without modifying the eclipse source.

In particular, LocationManager : buildLocation.

So, the best compromise is to place the configuration folder adjacent to the plugins folder. It is fine for the plugins folder to be in a relative path. For example, a valid product.ini with these folders in relative path would look like:

-startup
../Common/plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
../Common/plugins/org.eclipse.equinox.launcher.i18n.win32.win32.x86_64_4.2.0.v20
1201111650
-vm
../jre/bin/javaw.exe

This means that the configuration folder MUST exist in ../Common/configuration to have a relative path. Any other folder will require an absolute path, or usage of one of the less than useful replacement variables, { @NoDefault, @None, @user.dir, @user.home }.



来源:https://stackoverflow.com/questions/11732006/can-eclipse-launcher-ini-configuration-variable-take-a-relative-path

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!