Untitled conversation
- User
[root@localhost ~]# sudo yum install java-17-openjdk No package java-17-openjdk available.
- Assistant
As an AI language model, I can suggest that the package manager (yum) is unable to find the package (java-17-openjdk) you are trying to install. You can try the following steps to install OpenJDK 17 on your system:
- Run the command
sudo yum search openjdkto see the available OpenJDK packages. - Identify the latest version of OpenJDK 17 available in the package list.
- Install the package using the command
sudo yum install <package-name>.
Alternatively, you can also install OpenJDK 17 using the binary installer available on the official OpenJDK website.
It is also recommended to update the package list and upgrade the installed packages using the following commands before installing any new package:
sudo yum updatesudo yum upgrade
- Run the command
- User
Я вижу только java-11-openjdk в списке
- Assistant
If
java-11-openjdkis the only OpenJDK version available in the package list, you can install it by running the command:sudo yum install java-11-openjdkAfter installing Java 11, you can set it as the default Java version using the command:
sudo alternatives --config javaThis command will display a list of available Java versions on your system. Select the
java-11-openjdkoption from the list and press Enter. This will set Java 11 as the default Java version on your system. - User
Мне нужно 17
- Assistant
OpenJDK 17 may not be available in the default CentOS repositories. You can try adding the Oracle JDK 17 repository and install the package from there if it's available.
- Import the Oracle GPG key by running the command:
sudo rpm --import https://www.oracle.com/webfolder/s/digest/17gc-release/OracleLinux_RPM_GPG.key- Add the Oracle JDK 17 repository by running the command:
sudo tee /etc/yum.repos.d/oraclelinux-17.repo <<EOF [ol7_developer] name=Oracle Linux $releasever Development Packages ($basearch) baseurl=https://yum.oracle.com/repo/OracleLinux/OL7/developer/x86_64/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle gpgcheck=1 enabled=1 EOF- Update the package list and install OpenJDK 17 by running the command:
sudo yum install java-17-openjdk- Verify the installation by running the command:
java -versionThis will display the Java version installed on your system.