JDKPathPanel problems with JDK 11

112 views
Skip to first unread message

Phil Baxter

unread,
Jan 21, 2021, 6:35:37 AM1/21/21
to izpack-dev
I am trying to update an old installer so that we can use it on system with JDK 11 and possibly newer.

So, I pulled master branch from github and built locally as we use maven I am not aware of any snapshots published in maven central.

Our project builds correctly, however there are a couple of things that aren't quite looking right, one fairly minor, the other a more serious issue...

1) [Minor] The JDKPathPanel appears to use the wrong label for the path selection, it has "Select the installation path:" instead of "Select the JDK path:". Looking at the code, its not obvious where this is set, the correct value is present in the string JDKPathPanel.intro defined (for us) in eng.xml

2) [Not so Minor] Detection of JDK fails even when both JAVA_HOME points at the correct one and the installer is being executed from the correct one.

Something that may be relevant is that I have several JDK's installed on my system ranging from JDK 8 through JDK 15, I switch JAVA_HOME to the one I need for specific testing/projects. i.e. I switch to JDK 8 to build IzPack, then back to JDK 11 when I build and run my product installer.

Are these already known issues, if so is someone working on them?

I would be quite happy to have a try and fix these and submit a pull request, but, I am short on time presently and so if you would like me to do this some pointers towards where I should be looking to fix this would be useful.

Phil Baxter

unread,
Jan 21, 2021, 7:26:09 AM1/21/21
to izpack-dev
Some more background information on my environment:
I am currently running on Windows 10 and have Oracle JDK 8 installed as well as OpenJDK 11, 13 and 15

I haven't even started to look at Linux or osx yet (both of we we need to eventually support)

So, after a bit more digging, I see that JDKPathPanelHelper is using "Software\\JavaSoft\\Java Development Kit"
as a JDK_ROOT_KEY, this seems a bit dangerous/hit and miss as this is registry entry appears to be Oracle only,
none of my OpenJDK installations have attempted to set this registry entry (I see in the code that something
similar may be done for OSX!).

I suspect this to be the root cause of my problem as although my installer is running under JDK 11, because this
registry entry is set to JDK 8 the installation doesn't think that I am running the correct java version!

Would using system properties work instead (I haven't tested this) but, is something like jdk.module.main only
available if running with a JDK? I realise this only works for the running instance, but maybe running a quick
simple short java program via the java image in the selected JDK directory may achieve the same or a similar
result.

Finally, the JDKPathPanel has a field for the location of the JDK, by default, this gets populated with what looks
like to location of the installer jar, this may be better if populated with the value of the java.home system property
which whilst most likely incorrect may well be in a closer location to the desired JDK than the installers folder.
Reply all
Reply to author
Forward
0 new messages