I know that in the past this was not possible due to license issues of the Java JRE.
Things have changed with JRE 9/11 and OpenJDK.
Has anyone already done this? I have basically the following questions
1) What JRE can we bundle?
As mentioned by Mike and Wayne with the link to the bug, the current answer is "none", at least as long as the IDE is distributed on Eclipse.org and the Board didn't approve the inclusion of whatever JRE in Eclipse distributions.
Because of the obvious handicap it can be for Eclipse project success, our devoted committer representatives at the Board are actively trying to move this forward, but without success so far (you can read the minutes at https://www.eclipse.org/org/foundation/minutes.php#board
), I'm pretty sure your message with add fuel to upcoming discussions ;)
In the meantime...
3) Has anyone done this already so that we can also have a look how to do this (via Jenkins/Maven scripts)?
For p2 products, yes, I have a branch partly ready: https://github.com/mickaelistria/org.eclipse.epp.packages/tree/506244/runtime
. IIRC, it was working on Linux at least, and embeds AdoptOpenJDK build (but is agnostic on that matter). To get it working, just build those p2 installation units, and include them in your .product. They will automatically include the JRE and set the `-vm` flag to work with the included JRE.
I don't plan to work on it until the legal part of fixed or worked-around for the Eclipse IDE, but feel free to create a fork and have fun with it. The technical part would better be discussed on the epp-dev mailing-list I guess.