The VM is picked by the Execution Environment in the bndrun file.
IMHO it would make more sense to consider the JRE which is configured in the run configuration that is created. It seems pointless to have the option there the select the JRE if it is not considered⦠mind, I am not voting for removing the option, but rather for considering it.
The problem is that the run configuration is hidden Eclipse info. It is not available to Gradle or other build systems.
I think it makes sense to connect the VM to the bndrun although it would be nice to specify that the latest available VM could be used. I admit that the VM is a bit of a limbo zone for bnd, leaving parts of it to Eclipse.
Now I get a new error when trying to run a JUnit tests in OSGI
org.osgi.framework.BundleException: Could not resolve module: biz.aQute.tester.junit-platform [238]
Unresolved requirement: Import-Package: aQute.bnd.build; version="[4.5.0,5.0.0)"; resolution:="optional"
Unresolved requirement: Import-Package: aQute.bnd.service; version="[4.8.0,5.0.0)"; resolution:="optional"
Unresolved requirement: Import-Package: junit.framework; version="[3.8.0,5.0.0)"; resolution:="optional"
Unresolved requirement: Import-Package: org.apache.felix.service.command; version="[1.0.0,2.0.0)"; resolution:="optional"
Unresolved requirement: Import-Package: org.junit; version="[4.10.0,5.0.0)"; resolution:="optional"
Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=17))"
at org.eclipse.osgi.container.Module.start(Module.java:463)
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:445)
at aQute.launcher.Launcher.start(Launcher.java:699)
at aQute.launcher.Launcher.startBundles(Launcher.java:679)
at aQute.launcher.Launcher.activate(Launcher.java:585)
at aQute.launcher.Launcher.launch(Launcher.java:404)
at aQute.launcher.Launcher.run(Launcher.java:186)
at aQute.launcher.Launcher.main(Launcher.java:162)
at aQute.launcher.pre.EmbeddedLauncher.executeWithRunPath(EmbeddedLauncher.java:170)
at aQute.launcher.pre.EmbeddedLauncher.findAndExecute(EmbeddedLauncher.java:135)
at aQute.launcher.pre.EmbeddedLauncher.main(EmbeddedLauncher.java:52)
I donāt quite get why there is a capability requirement for Java 17⦠this is a Java 8 project I am trying to use hereā¦
The capability requirement for Java 17 is being introduced by the tester bundle. The tester bundle is added to the end of you runbundles at launch time. The problem is that the 7.0.0 version of the bundle is being added (which has the Java 17 requirement).
I will try and look into this more closely. One more thing to try in the meantime: try adding biz.aQute.tester.junit-platform;version="[6.4,7)" to runrequires rather that runpath.