

Set variables based on the Java location and version. In order to install java 11: sudo amazon-linux-extras install java-openjdk11 For java 8 you can try: sudo yum install java-1.8.

Install Maven by typing the following command in your terminal: sudo yum install maven. Installing Maven on CentOS 7 using yum is a simple, straightforward process. Accept the license agreement and download. Java applications often require JAVA environment variables to be set in the system.Ĭreate a new file under /etc/profile.d directory. Installing Apache Maven on CentOS with Yum. Installing Oracle Java SE Navigate to Oracle Java SE downloads page, and choose the version of Java you wish to use. The output may vary depending upon the package and the version you chose to be the default Java version. jenkins package sudo dnf install java-11-openjdk sudo dnf install jenkins sudo. OpenJDK 64-Bit Server VM 18.9 (build 11.0.11+9-LTS, mixed mode, sharing) Long Term Support release Weekly release Installation of Java. OpenJDK Runtime Environment 18.9 (build 11.0.11+9-LTS) Verify Java VersionĬheck the java version using the following command. There are 3 programs which provide 'java'.ġ java-11-openjdk.x86_64 (/usr/lib/jvm/java-11-openjdk-11.0.11.0.9-2.el8_4.x86_64/bin/java)Ģ java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.8_4.x86_64/jre/bin/java)Įnter to keep the current selection, or type selection number: 1Įnter the number below the selection column to set the default Java version. If your system has multiple Java versions, the above command will list all Java versions like below. Use the alternatives command to set the default java version. To install Oracle JDK to a custom directory, use rpm -ivh –prefix=// rpmfile command. By default, Java JDK is installed in /usr/java/ directory.
