I want my program to be usable by systems which do not have a JRE preinstalled.
What I'm a little bit struggling with right now is how can I tell Maven to use an embedded JRE and not the system JRE? Right now to build my application I'm using the maven-assembly-plugin along with the maven-nativedependencies-plugin to resolve native dependencies and the maven-jar-plugin.
My understanding in theory is somewhat of the following:
- Copy(?) JRE into my project folder (e.g. a folder with java8)
- Zip everything up (Somehow included in my build process)
- Tell Maven to use the included JRE
- User can unpack and does not need a preinstalled JRE
I assume that I somehow need to tell maven/my application to unpack that shipped JRE and use it? I already read about the Java 9 Deployment guide (I'm using Java8 though) and jlink'ed images, however all of it seems a little bit tricky and I'm not build process expert.
Could anyone share their experiences / thoughts on that topic?