How To Install java-1.8.0-openjdk-src.x86_64 on Amazon Linux 2

In this tutorial we learn how to install java-1.8.0-openjdk-src.x86_64 in Amazon Linux 2. java-1.8.0-openjdk-src.x86_64 is OpenJDK 8 Source Bundle

Introduction

In this tutorial we learn how to install java-1.8.0-openjdk-src.x86_64 on Amazon Linux 2.

What is java-1.8.0-openjdk-src.x86_64

The java-1.8.0-openjdk-src sub-package contains the complete OpenJDK 8 class library source code for use by IDE indexers and debuggers.

We can use yum to install java-1.8.0-openjdk-src.x86_64 on Amazon Linux 2. In this tutorial we discuss both methods but you only need to choose one of method to install java-1.8.0-openjdk-src.x86_64.

Install java-1.8.0-openjdk-src.x86_64 on Amazon Linux 2 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

After updating yum database, We can install java-1.8.0-openjdk-src.x86_64 using yum by running the following command:

sudo yum -y install java-1.8.0-openjdk-src.x86_64

How To Uninstall java-1.8.0-openjdk-src.x86_64 on Amazon Linux 2

To uninstall only the java-1.8.0-openjdk-src.x86_64 package we can use the following command:

sudo yum remove java-1.8.0-openjdk-src.x86_64

java-1.8.0-openjdk-src.x86_64 Package Contents on Amazon Linux 2

/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.312.b07-1.amzn2.0.2.x86_64/src.zip
/usr/share/doc/java-1.8.0-openjdk-src-1.8.0.312.b07
/usr/share/doc/java-1.8.0-openjdk-src-1.8.0.312.b07/README.md

References

Summary

In this tutorial we learn how to install java-1.8.0-openjdk-src.x86_64 on Amazon Linux 2 using yum.