March 6, 2023
Installing JDK 11.0.18 on server removes all other JDK 11 installations
Comments
(3)
March 6, 2023
Installing JDK 11.0.18 on server removes all other JDK 11 installations
Newbie 2 posts
Followers: 0 people
(3)

Although not directly related to ColdFusion per se, I just came across what could be considered a serious issue when preparing to update the underlying JVM used for CF 2021 from 11.0.16 to 11.0.18.

When updating the JVM previously, I have installed the new JDK (Oracle, downloaded from the Adobe site) to sit alongside the existing JDKs already installed:

C:\Java\jdk-11.0.12
C:\Java\jdk-11.0.14
C:\Java\jdk-11.0.16

I have then updated the path to the JVM in the CF Administrator, and manually updated a couple of config files in the CF instance directory tree. I’m sure most of you have done the same thing on many occasions.

This time around, however, when I ran the JDK installer, and manually changed the installation path to C:\Java\jdk-11.0.18, it proceeded to remove the 11.0.12 and 11.0.14 versions, and install 11.0.18 in the 11.0.16 directory, reporting that some processes were already using the JDK (not surprising, CF and add-on services were still running).

This new installation behavior seems to me to be incredibly problematic for server administrators who want to prepare the new JDK in advance, switch to it, then have the old version ready to fall back to if something goes wrong when running CF with the new version. Not an unusual scenario, surely?

I tracked down this change of behavior to the release notes for JDK 11.0.18:

https://www.oracle.com/java/technologies/javase/11all-relnotes.html#R11_0_18

In the ‘Other Notes’ section:

Disable Side-by-Side Installations of Multiple JDK Updates in Windows JDK Installers (JDK-8292822)

Windows JDK installers must install the Oracle JDK in %Program Files%\Java\jdk-%FEATURE% instead of %Program Files%\Java\jdk-%VNUM%. I.e. all updates of the same release must share one installation directory.

Thus the 11.0.18 and 11.0.19 releases will both install into %Program Files%\Java\jdk-11 by default, and they both cannot be installed at the same time.

If the JDK11.0.19 installer is launched when JDK11.0.18 is already installed, it will auto-upgrade them to JDK11.0.19. There may be a Files In Use dialog shown if the older version was running and locking JDK files.

If the JDK11.0.18 installer is launched when JDK11.0.19 is already installed, it will show an error that a newer version of this JDK family is already installed.

Unfortunately, the link to bug JDK-8292822 is password-protected, and I do not have access to this site, so am unable to read why this decision was made:

https://bugs.openjdk.org/browse/JDK-8292822

What do other people think about this change of behavior? Have you managed to find a workaround to allow two or more versions to be installed side-by-side?

Thanks for reading my long-winded rant, and I look forward to hearing others’ thoughts.

3 Comments
2023-03-08 23:48:33
2023-03-08 23:48:33

Thanks Charlie, appreciate the response. Your blog post certainly covers the issue in much more detail, a very good read.

Just out of interest, have you been able to get to the bug details for JDK-8292822, either by being able to log in to the link in my original post, or maybe someone has provide you with the text from the issue?

Like
(1)
>
Michael Clark
's comment
2023-03-08 23:56:32
2023-03-08 23:56:32
>
Michael Clark
's comment

Thanks for the kind regards, Michael. As for the bug there, no, I don’t have an account.

But I suspect it’s simply driven by a motivation to have the installer always by default install only one version (since the installer does other things at the OS level, like set env vars, etc.) and always to the same place.

I do of course appreciate the pain it causes due to the oddities of “pulling the rug out from under” running processes like CF (sometimes, though sometimes it at least tells us to shut them down), I do think in the long run most people who use the installer will how the change simplifies things (one jdk installed at the default location), while those who want to “run more than one” can just switch to using the zip extraction approach instead.

If you ever do learn more (about that bug), or if anyone else knows, please do let us know here.

Like
2023-03-08 17:19:55
2023-03-08 17:19:55

Michael, given your last question (“what do other people think about this…”), I offer my post about this from a few weeks ago:

Beware that latest Oracle JDK installers will REMOVE older JDK installs of that version

You’ll see I expressed the same surprise and concern (and desire to warn others) as you do here, when I experienced it the problem a week after the new JVM installer was released Jan 17. 

Glad to see your post here also. There’s always value in multiple notifications and perspectives.

As you note (but we should draw out), this is ONLY about the installers. It does NOT affect those who extract the JDK zip instead (and that’s one “workaround” for you to consider, as I discuss in the post).

Also, note that it’s NOT just about Windows, but also MacOS and RHEL (see the other sections in that release notes, “All JDK Update Releases Are Installed Into the Same Directory on macOS” and “RPM JDK Installer Changes”), as I note in my post.

I add still more info in my post that you or other readers might appreciate. There are also some “pros” to the new installer’s approach, but bottom line, yes: this will be a challenge for us for months to come, as people who use the Oracle JDK installer may trip over it.

Like
Add Comment