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
/data
directory. Note that it has a/bin
sub directory withjava
orjava.exe
and/lib
withrt.jar
in it. - Edit
<artifactId>
and<version>
values inpom.xml
file as appropriate. Make note of the comments as to the format. - Run
mvn clean package
. - Your
jar
andpom
files would be in the/target
directory. - Upload (deploy) your
jar
andpom
to 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