The best way to set up Java 8/11 on Amazon Linux 2023

Right here we journey during the instructions to be had to put in Java 11 or 8 on Amazon Linux 2023 for manufacturing or industry packages on your cloud infrastructure. Java is to be had during the Amazon 2023 repositories as Corretto.

However, what’s Amazon Corretto?

Amazon Corretto is a distribution of the Clear Java Construction Equipment (OpenJDK) advanced and maintained by means of the Amazon Internet Products and services (AWS) Staff. That is designed to importance at the AWS Linux platform to get an a variety of benefits when working Java packages. Listed below are one of the most the reason why you must make a choice Java Corretto to assemble or run packages on Amazon:

  • Amazon Corretto is supposed to lend top efficiency and balance by means of offering computer virus cures, and safety patches.
  • Lengthy-Time period Aid (LTS) for primary Java variations usually for no less than 8 years from the preliminary let go.
  • Corretto is designed with safety in thoughts.
  • It undergoes rigorous trying out and verification processes to assure compatibility with common Java packages, libraries, and frameworks.
  • Isolated of price
  • Supported by means of a immense and energetic public of Java builders and AWS customers.

Step 1: Replace Your Machine:

Get entry to your Amazon Linux 2023 command terminal the use of SSH and after blast the machine replace command. It is going to set up the unedited to be had updates, if any, plus rebuild the DFN bundle index cache.

sudo dnf replace

Step 2: Set up Corretto or Java on Amazon 2023

Not like Amazon Linux 2, AWS’s Corretto is a production-ready distribution of OpenJDK to be had during the default machine repository of Amazon Linux 2023. So, we will be able to set up Java with out including any excess repository.

Simply on your command terminal kind:

For Java 8:

To get JRE

sudo dnf set up java-1.8.0-amazon-corretto

To get JDK

sudo dnf set up java-1.8.0-amazon-corretto-devel

For Java 11:

For JRE 11

sudo dnf set up java-11-amazon-corretto

For JDK 11

sudo dnf set up java-11-amazon-corretto-devel

Step 3: Take a look at put in JAVA Model

Through following the above instructions you’re going to unquestionably have the Java edition you need to put in in your Amazon Linux 2023. To verify that we will be able to importance the given command.

java -version
Check installed JAVA Version 

Step 4: The best way to Transfer between Java variations

In case you have a couple of Java variations put in in your Amazon Linxu 2023 let’s say you’ve gotten each Java 8 and Java 11 in your machine. Now, to change between and construct any one in every of them the default Java edition of your machine, we will be able to importance the “alternative –config” command.

possible choices --config java

Sort the Variety collection of the Java you need to poised as default machine one and clash the Input key.

Switch between Java versions

Alternative Articles:

Leave a Comment