3 different Openjkds on RHEL7 with YUM

Viewed 32

I need to install 3 different versions of openjdk (11.0.5, 11.0.6, 11.0.7) on EL7.

I see all 3 versions available in RHEL7 repo but there is an ask to install all package files for 0.5/0.6 in user custom location while 0.7 should be installed in default location.

I need to use YUM to avoid altering the RPM DB outside of YUM and I need to make sure that YUM update will not upgrade 0.5/0.6.

Tar.gz is no longer available since 0.6 so I want to use OpenJDK from RHEL repo.

Shall I use "update-alternatives —list”, "yum --installroot= install ” or some other way? I was suggesting to use virtual_env but that was rejected.

Thanks for your thoughts!

1 Answers

I don't think that is possible. If you just want to use the packages to get your hands on the code, you can extract the files from the older packages manually:

rpm2cpio ./openjdk-11.0.5.rpm | cpio -idmv

You can then install those wherever you want. Note that the files will thus not be tracked by rpm, and will thus not be updated/removed by rpm.

Related