How can I run a subprocess in Equinox with dynamic bundle installation?

you can use the Equinox Launcher API.
Here’s an example of how you can use the Equinox Launcher api to launch a new instance of equinox with a set of bundles:
`

EquinoxLauncher launcher = new EquinoxLauncher();
String equinoxHome = "/path/to/equinox/home"; 
String[] bundlePaths = { "/path/to/bundle1.jar", "/path/to/bundle2.jar" }; 

EquinoxRunConfiguration runConfig = launcher.newConfiguration();
runConfig.setWorkingDir(new File(equinoxHome));
runConfig.setFramework(new File(equinoxHome, "plugins/org.eclipse.osgi.jar"));
runConfig.addProgramArg("-console");
runConfig.addProgramArg("-noExit");
for (String bundlePath : bundlePaths) {
    runConfig.addBundle(new File(bundlePath).toURI());
}

EquinoxRunMonitor monitor = launcher.launch(runConfig);

`

Leave a Comment