java, aws, amazon linux 2,

Install Java 8 on Amazon Linux 2

Oct 10, 2022 · 1 min read · Post a comment

As a distinction from Java 11, OpenJDK 8 package can be found under default yum repositories. Let’s install Java 8 on Amazon Linux 2.

Prerequisites

  • Amazon Linux 2
  • sudo privileges

Install Java 8 on Amazon Linux 2

Step 1. To install Java 8 on Amazon Linux 2, run:

sudo yum install java-1.8.0-openjdk

Step 2. Verify the Java Version.

java -version

Step 3. To switch the Java version, run:

alternatives --config java

Conclusion

Feel free to leave a comment below and if you find this tutorial useful, follow our official channel on Telegram.