Is a small Maven project which packs given binary (e.g, JRE) into a JAR with a POM. Result can be added to a private Maven repository and referenced by your builds. This can be handy for those who check in the JRE into the source control system, and looking for the ways to reduce its size.
- Copy your JRE to
/datadirectory. Note that it has a/binsub directory withjavaorjava.exeand/libwithrt.jarin it. - Edit
<artifactId>and<version>values inpom.xmlfile as appropriate. Make note of the comments as to the format. - Run
mvn clean package. - Your
jarandpomfiles would be in the/targetdirectory. - Upload (deploy) your
jarandpomto your company's private Maven repository.
In rear situations you would need to access JRE binary from within a Java application as a resource. Resulting JAR offers the following interface for your convenience:
ServiceLoader.load(PackedJre.class).forEach(jre ->
{
System.out.println("JRE found: "+ jre.getVendor() +" - "+ jre.getPlatform() +" - "+ jre.getVersion() +" - "+ jre.getPath());
});
or try this to get individual file entries along with MD5s:
PackedJres.getAll().forEach(jre ->
{
jre.getEntries().forEach(file -> {
System.out.println(file.getName() +", MD5:"+ file.getMD5());
});
});
Consider getting you JRE from https://bintray.com/jetbrains/intellij-jdk