8

Currently there is no possibility to install java-17-openjdk through sudo yum install java-17-openjdk on a CentOS 7 system (CentOS Linux release 7.9.2009 (Core)) as it was possible some time ago. When I now search for other openjdk versions, I can find the packages

java-1.6.0-openjdk java-1.7.0-openjdk java-1.8.0-openjdk java-11-openjdk java-latest-openjdk (OpenJDK 18) 

Also looking at https://rpmfind.net/linux/rpm2html/search.php?query=java-17-openjdk I cannot find an entry for CentOS 7.

I need OpenJDK 17. Is there some possibility to install it through a rpm package or any other alternative?

2
  • You may always download the JDK, unpack it to a certain folder, and update all needed Environment-Variables to make it work. Does it have to be installed via a package? Commented May 23, 2022 at 10:19
  • 2
    I don't know which environment variables has to be changed and which values they need. Commented May 23, 2022 at 10:40

2 Answers 2

3

You might simply build this yourself. If it worked before, chances are the build for Fedora works. You will need a Fedora 34+ host to cross-build this.

# Don't build as root. Only need root privileges to install `fedpkg`, sudo dnf install -y fedpkg # Now get the package description git clone https://src.fedoraproject.org/rpms/java-17-openjdk # Use fedpkg to kick off a mock build cd java-17-openjdk fedpkg mockbuild --root centos-7-x86_64 

This will take a while¹; and in the end, you should be getting a line that tells you where the RPMs you've just built were put.


¹ mock sets up a chroot, in which it installs a CentOS 7 base system, then EPEL, which you'll almost certainly will need, I think, then the tools necessary to build any RPM, then the build-time dependencies of the java-17-openjdk package. Then it will download all the necessary source code, hand off to rpm-build to do the build, which includes applying all patches, then compiling OpenJDK, then, running the OpenJDK installation, collecting the installed files, compressing them into valid RPMs.

3
  • note: on RHEL7 use yum instead of dnf to install fedpkg which seems to work, then the fedpkg run fails Commented Mar 24, 2023 at 12:43
  • 1
    @splaisan that's why I said you need Fedora >= 34; RHEL 7 just lacks too much. Commented Mar 24, 2023 at 12:57
  • 1
    My bad, i was so in it i did not read you well. I will have to reinstall that server one day..... Commented Mar 25, 2023 at 13:55
1

Use Temurin. You'll need the Adoptium yum repo configuration from https://adoptium.net/installation/linux/

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.