3

Config.ini file is having the property osgi.bundles which contains the list of plugins that needs to be started while launching my RCP. For Eg.:

osgi.bundles=reference\:file\:org.junit_4.8.2.v4_8_2_v20110321-1705/@4,reference\:file\:org.mortbay.jetty.server_6.1.23.v201012071420.jar@4,reference\:file\:org.mortbay.jetty.util_6.1.23.v201012071420.jar@4

Clarification : I need to use the Java variables/Environment variables in the reference of the plugins. So that I can make my RCP more flexible. Please suggest a solution.

I need something like below:

osgi.bundles=reference\:file\:{ENV.USERDIR}/org.junit_4.8.2.v4_8_2_v20110321-1705/@4

Here when trying the load the bundles, JUNIT bundle should be loaded from the replaced from the environment variable USERDIR as.

c:/users/username/org.junit_4.8.2.v4_8_2_v20110321-1705

Any help is appreciated.

Thanks in advance, Vikram

Sangam Belose
  • 4,262
  • 8
  • 26
  • 48
Vikram Aruchamy
  • 163
  • 1
  • 11
  • The Eclipse code that reads `osgi.bundles` (`org.eclipse.core.runtime.adaptor.EclipseStarter`) doesn't support this. – greg-449 Sep 19 '17 at 07:01
  • I have modified the code in EclipseStarter which reads inosgi.bundles. But i am not able to read vaiables. Are you sure if Eclipse starter is running the program after generating the product? – Vikram Aruchamy Sep 21 '17 at 12:47
  • Well have you built a new version of the `org.eclipse.osgi` plugin containing your modified EclipseStarter and made sure that that plugin is being invoked during startup? – greg-449 Sep 21 '17 at 13:04
  • Yes i have made sure that new version is being used.. Do you have any idea about WebStartMain? – Vikram Aruchamy Sep 21 '17 at 13:28

1 Answers1

4

This is supported in org.eclipse.equinox.launcher_V1.3.0 or higher. You can use the environment variables like

$variable_name$/bundle-name.jar.

While parsing the config file, The launcher will substitute the value of the variable and start the bundle from the specified location.

Vikram Aruchamy
  • 163
  • 1
  • 11