Skip to content

Instantly share code, notes, and snippets.

@concosminx
Last active June 6, 2022 10:03
Show Gist options
  • Save concosminx/c0471cee65bd2ec8cc3c964397ff70bf to your computer and use it in GitHub Desktop.
Save concosminx/c0471cee65bd2ec8cc3c964397ff70bf to your computer and use it in GitHub Desktop.
Install Java on Rocky Linux

Install Java (Open JDK | Oracle) on Rocky Linux

  1. Install Open JDK using yum

sudo yum install java-17-openjdk java-17-openjdk-devel

  1. Install Oracle JDK
  • install wget | curl sudo dnf -y install wget curl
  • get the RPM file from oracle curl -O https://download.oracle.com/java/17/archive/jdk-17.0.3.1_linux-x64_bin.rpm
  • install the pacakge sudo rpm -Uvh jdk-17.0.3.1_linux-x64_bin.rpm
  1. Set the default java version

sudo alternatives --config java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment