The Oracle JDK is a requirement for a non-technical reason, and I am not at liberty to discuss the nature of those non-technical requirements on a public communication channel.
I know, that sounds more mysterious than it actually is. :-)
An Oracle JDK license is only required for Oracle Java SE 11+, and for updates to Oracle Java SE 8 released after January 2019.
From which you can deduce that the exact JDK 8 version we use, is 8u221.
We have jobs that have to run the same identical code on different JDK versions.
Past experiences (implementation changes in Collections, legacy code using sun.* imports,...) have learned us the hard lesson that we should not trust JDK compatibility between versions, so we run our code in parallel on _all_ JDK versions that we support.
I seriously hope that it stays a secret that there are about a dozen different JDK vendors/distributions these days, build times are already long enough as it is now with what we have...
Code snippet to illustrate:
static javaVersions = ['jdk-8-oracle', 'jdk-11-openjdk', 'jdk-13-openjdk', 'jdk-14-openjdk', 'jdk-15-openjdk', 'jdk-16-openjdk']
When you write "unpacked in a user directory", what does that mean exactly for you?
A) JDK is "installed" in advance on the agent, either manually (next-next-next-finish) or configuration management (Chef, Puppet, Ansible,...)
B) JDK is "installed" by Jenkins, using https://$JENKINS_URL/configureTools/ -> JDK installations
We do B, but now you've got me thinking that you maybe do A?
Do you use only one single JDK version ever on each agent?
I wrote "installed", because that can either be
* Windows Installer, for Oracle JDK
I haven't really seriously looked at the difference between OpenJDK and AdoptOpenJDK.
--
Amedee Van Gasse