大网数据广告活动
服务器运维问答

How do I install 2 different versions of java on the same machine from EPEL

· 52CE 我爱测

Title says it all. I want to have 2 versions of java on the same machine. For example 14.0.1.7 and 14.0.2.12 (which are both in EPEL7 repo). If i install them one by one via yum , yum will remove first version and keep just the l…

问题原文

原帖链接 · dsmoljanovic · CC BY-SA 4.0

Title says it all. I want to have 2 versions of java on the same machine. For example 14.0.1.7 and 14.0.2.12 (which are both in EPEL7 repo).

If i install them one by one via yum, yum will remove first version and keep just the last. If I install them via rpm dependencies are resolved but not installed automatically. If i install first with yum and second with rpm then it works and it keeps both versions but rpm won't install any additional dependencies if the pop out at some point and it would be cool to be able to do it via only one tool.

All mentioned java are OpenJDK; EPEL7 has these rolling packages (for example: java-14-openjdk-14.0.1.7-2.rolling.el7.x86_64, java-14-openjdk-14.0.2.12-1.rolling.el7.x86_64).

Any ideas?

已采纳解答

原帖链接 · John Mahowald · CC BY-SA 4.0

You don't. Upgrade to the later package, which has fixes.

java-latest-openjdk 14.0.2.12-1 replaces 14.0.1.7-2. EPEL mirrors won't carry the old version, as is their usual policy.

The upstream release notes say the security patched version of 14 is 14.0.2+12. Note the usual time zone data and x509 cert changes, plus bug fixes. Think about whether you really need to pin this version. The documentation indicates this to be a minor maintenance release you are intended to take.

If you identify a need to keep the previous version, two problems to resolve: getting the package and installing it. The old version is no longer on the mirrors, consider setting up your own private mirror or caching proxy to archive old versions. And, these two versions cannot be installed in parallel. Investigate a way to have two parallel environments, whether containers, virtual machines, or runtime manager utilities which specifically allow you to select a Java runtime.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2020-09-15)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。