I'm using this in a product now. Only part that was
tricky was osx version to support MacOSX-specific installers.
For linux/windows, it should work if you are consistent.
To ensure consistency, I use the JRE version as my version
number and avoid qualifiers.
From a core feature.xml,
<includes
id="cc.feature.jre.win32.win32.x86"
version="1.8.74" <!-- version here for
1.8.0_74 -->
optional="true"
os="win32"
ws="win32"
arch="x86"/>
<includes
id="cc.feature.jre.win32.win32.x86_64"
version="1.8.74"
optional="true"
os="win32"
ws="win32"
arch="x86_64"/>
...
From cc.feature.jre.win32.win32.x86_64/feature.xml
<feature
id="cc.feature.jre.win32.win32.x86_64"
label="%featureName"
version="1.8.74" <!-- version match -->
provider-name="%providerName"
plugin="cc.branding"
os="win32" <!-- os match -->
ws="win32" <!-- ws match -->
arch="x86_64"> <!-- arch match -->
From the cc.feature.jre.win32.win32.x86_64/p2.inf
instructions.configure=\
org.eclipse.equinox.p2.touchpoint.eclipse.setJvm(jvm:features/cc.feature.jre.win32.win32.x86_64_1.8.74/jre/bin);
org.eclipse.equinox.p2.touchpoint.natives.remove(path:jre);
instructions.unconfigure=\
org.eclipse.equinox.p2.touchpoint.eclipse.setJvm(jvm:null);