John Dill
Posts: 9
Joined: Tue Dec 02, 2014 10:23 pm

Java JRE update question

Hi,

It's been a while, but I've been looking at updating our application's Advanced Installer project. I'm not a Java developer, I just maintain the build scripts and makefiles to build the project and create the installer from the command line.

Originally the project aip was set to package a JRE like 'C:\Program Files (x86)\Java\jre1.8.0_251' that could be selected in the Advanced Installer GUI and everything went well (it's been a few years since I looked at it). I see that now we're using OpenJDK 14.0.2 looking at the installation path.

I tried running the application manually after building with OpenJDK 14 but trying to run it using JRE 1.8 and it seems there's too much separation between the versions to the point that the application GUI doesn't show up and it just hangs. So I need a more recent JRE that's compatible with JDK 14.

Doing a little research shows that you can now create your own JRE with jlink, but I'm unfamiliar with the steps to go about trying to make my own from the JDK, and then how to package it in Advanced Installer.

Anyone had luck getting this to work? Just checking to see if anyone's done the hard work before I try to figure it out myself.

Thanks,
John
John Dill
Posts: 9
Joined: Tue Dec 02, 2014 10:23 pm

Re: Java JRE update question

Just to clarify, I can use my build script to run a jlink command to create the jre folder, but when I try to select it from Java section in Advanced Installer, it says it's not a valid JRE.

OpenJDK 14.0.2
jlink --add-modules java.base,java.desktop --output jre

Then try to select that JRE folder with Advanced Installer 16.7, and it no likey.

I can run the application ok using

jre\bin\java.exe -cp jar1;jar2;jar3 app.Main

Any suggestions?
Catalin
Posts: 6585
Joined: Wed Jun 13, 2018 7:49 am

Re: Java JRE update question

Hello John,
Doing a little research shows that you can now create your own JRE with jlink, but I'm unfamiliar with the steps to go about trying to make my own from the JDK, and then how to package it in Advanced Installer.

Anyone had luck getting this to work? Just checking to see if anyone's done the hard work before I try to figure it out myself.
Unfortunately, I'm afraid my expertise with OpenJDK is not so wide either.
Just to clarify, I can use my build script to run a jlink command to create the jre folder, but when I try to select it from Java section in Advanced Installer, it says it's not a valid JRE.
As for this moment, OpenJDK is not currently supported in Advanced Installer.

However, I am not 100% sure this would affect bundling your JRE in Advanced Installer.

First of all, could you please make sure that the location matches the "Package Type" of your setup?

For instance, if in "Install Parameters" page --> "Package Type" --> your setup is set as 32-bit setup, the location of your JRE can not be the %programfiles% folder (e.g. C:\Program Files), since that is a 64-bit location.

If the above does not help, could you please try a version of OpenJDK that has a JRE already included in it and let me know if it works?

I have done a bit of research and I have found that the following version of OpenJDK (third party) has a JRE bundled in it:

AdoptOpenJDK

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”