Self-extracting jre instructions _________________________________ NOTE: From early to mid 2026 we've moved from Java 8 to 11 for one OS after another. For Expeditee, rke-setup.sh/.bat automatically creates the JRE from JDK 11, then turns that JRE into a self-extracting binary. For Greenstone we've also moved to Java 11 since earlier this year (but again only mid 2026 for Mac), however the process has not (yet) been automated, because we have to actually first download the JRE tarball in order to be able to process it as we used to. 1. We've already committed the compiled up 64 bit versions of 7za and 7zCon.sfx for mac to svn, the 32 bit for Windows (also compatible with 64 bit Windows), and the 32 bit and 64 bit versions for linux. On Mac these are now present in release-kits/shared/mac/p7z-essentials folder. The 7za and 7zCon.sfx from the p7z-essentials folder are needed to generate the self-extracting jre from a jre. Look in the bitness subfolder (32-bit or 64-bit) appropriate to the target bitness of your self-extracting binary. On a mac or linux, you can compile these two binaries 7za and 7zCon.sfx up yourself by downloading the p7zip source code from online http://p7zip.sourceforge.net/. Compile the source code by first runnng "make" to build the 7za, then run "make sfx" to build the 7zCon.sfx binary. 2. Need the jre for your java version. On Macs it is ***ESSENTIAL*** since JRE 1.7 onward (currently we're on JRE 11), to follow the instructions in section (A) further below first, else the wrong folder gets renamed jre, then wrongly tarred up as jre.tar and wrongly turned into a self-extracting binary, causing the Greenstone installer to quickly fail. On finishing section(A), the JRE download would have been extracted and the correct folder would now be named jre. Also, don't make it a tar file for Expeditee. But Greenstone expects the jre to be tarred up first. If the self-extracting jre_bin binary should run on a 64 bit machine, use the 64 bit 7za compiled up in the 64-bit subfolder (this will use the associated 64 bit 7zCon.sfx library in the same subfolder). For a 32 bit machine, use the 32 bit 7za in the 32-bit subfolder. 3. Run: ./p7z-essentials/[32|64]-bit/7za a -sfx -mx=9 jre_bin[_x64] /path/to/your-jdk-version/jre[.tar] e.g. for a 32 bit target, you'd run the following on a 32 bit LSB if creating the self-extracting binary for Expeditee: ./p7z-essentials/32-bit/7za a -sfx -mx=9 jre_bin /path/to/your-jdk-version/jre e.g. for a 64 bit target, you'd run the following on a 64 bit LSB, if creating the self-extracting binary for Greenstone: ./p7z-essentials/64-bit/7za a -sfx -mx=9 jre_bin_x64 /path/to/your-jdk-version/jre.tar * -m0=lzma2 is already done automatically, setting the compression mode to lzma2. * -mx=9 set its (compression? speed?) to ultra * the output file name expected by the release-kit is jre_bin for 32 bit linux, jre_bin_x64 for 64 bit linux * -sfx indicates that it will generate a self-extracting binary out of the input file * the "a" indicates it will add the files from the input folder (the /path/to/your-jdk-version/jre in this case) to the output file If you see the message "Error: jre_bin_x64 is not supported archive", then cd into the p7z-essentials folder and run the ./7za command as above To get the JRE for a Mac, do one of the following: A. Now (at least since jre v 1.7.0_79) the Oracle site has a JRE for Macs available for download as dmg and tar.gz files. If this is available: 1. Download the JRE.dmg or JRE.tar.gz for the java version you want and extract it. 2. From the extracted contents, the folder you want is jre.jre/Contents/Home. Rename this Home subfolder to "jre". 3. Tar it up and create the self-extracting jre (the final step of the instructions above): ./p7z-essentials/[64-bit]/7za a -sfx -mx=9 jre_bin_x64 jre.tar If you see the message "Error: jre_bin_x64 is not supported archive", then cd into the p7z-essentials folder and run the ./7za command as above B. If no JRE.dmg or JRE.tar.gz for Mac is available: 1. Download the JDK.dmg for the java version you want. 2. Open the dmg, drag the .pkg out to another folder. 3. Extract the pkg using: xar -xf .pkg 4. Another couple of pkgs should appear, these are actually fake folders (like .app folders) 5. The one you want is the jdk.pkg. Rightclick > Show package contents to view its contents. 6. Then double click on the Payload item to extract Payload. Alternatively, since it's just a tarfile, you can do tar -xf jdk180.pkg/Payload 7. You get a Contents folder, then browse to Contents > Home > jre. That's the folder you want. C. For Expeditee, we're now bundling JDK with fx, not just a JRE, since the Expeditee application needs to use the Java compiler. We still create a self-extracting JRE for Expeditee so that it can run the Expeditee installer. When Expeditee's installer is finished, the extracted JRE gets moved into Expeditee's JDK as a jre subfolder. But we've shifted to JDK 11 (2026), and JDKs no longer come bundled with a JRE. Although we can download a separate JRE (of matching version to the JDK bundled with Expeditee), as we do for Greenstone, the JDK itself can be used to generate a JRE and made to include various dependencies. The rke-setup.sh/.bat scripts at https://trac.greenstone.org/browser/other-projects/expeditee-release-kits/trunk now automates the full process: it gets the selfcontained-jdk (which will get bundled with Expeditee), then generates the JRE from that JDK, then creates the self-extracting JRE binary from that JRE. Note: The rke-setup script also explains how to generate a JRE from a JDK that will contain all the dependencies that a target application will use. Expeditee for instance uses more than the basic JRE dependencies, so a bare bones JRE was insufficient for running Expeditee. Although the Mac code that runs Expeditee has now changed to use its JDK's java command to run expeditee (rather than its JRE's java command), the JRE has also been created to be sufficient for Expeditee. This automated process hasn't yet been repeated for Greenstone as we don't use a selfcontained-jdk to generate a JRE, but download the JRE we want to bundle. The next step of creating a self-extracting jre has also been left as a manual step. TODO: perhaps we can automate everything for Greenstone too by generating a jre from the selfcontained-jdk used to compile Greenstone? But it will have to be after we determine what dependencies Greenstone uses. I didn't know that JRE's can be created in a very cut-down way. Ideally we want an all-in-one JRE for Greenstone, as we only bundle a JRE and not a whole JDK with Greenstone like we do for Expeditee. Presumably downloading a JRE gives us an all-in-one JRE. Need to check with a chatbot as to how to generate a full, proper JRE (one that includes all dependencies). TODO 2: We could remove the JRE from Expeditee once installed, after making sure it is no longer used on Windows or Linux either (Mac at least has been changed to just use the JDK to launch Expeditee). In that case, the JRE can be generated as barebones again.