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

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

Introduction

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

What is java-1.7.0-openjdk-src.x86_64

The OpenJDK source bundle.

We can use yum to install java-1.7.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.7.0-openjdk-src.x86_64.

Install java-1.7.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.7.0-openjdk-src.x86_64 using yum by running the following command:

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

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

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

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

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

/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.261-2.6.22.2.amzn2.0.2.x86_64/src.zip
/usr/share/doc/java-1.7.0-openjdk-src-1.7.0.261
/usr/share/doc/java-1.7.0-openjdk-src-1.7.0.261/README.src

References

Summary

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