Bundling the JRE (Optional) - acrimi/Raven GitHub Wiki

If you don't want to worry about users having a separately installed JRE on their machine, you can optionally set up bundle your own with your packaged release.

First, you need to tell Launch4j that it should use a bundled JRE by specifying the bundledJrePath property:

launch4j {
  ...
  bundledJrePath = "${launch4j.libraryDir}/jre"
}

Then, similar to how you included assets, you can set up a task to copy your chose JRE to Launch4j's output directory:

task bundleJre(type: Copy) {
    from "C:\\Path\\To\\My\\jre"
    into "${buildDir}/${launch4j.outputDir}/${launch4j.bundledJrePath}"
}