Thank you for supporting the Cloud Customer Connect Community in 2024. It's a gift to work with you!

Look back
You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Oracle Linux: How to Remove Java from a Linux Instance

Applies To:

Linux OS–Version Oracle Linux 7.0 to Oracle Linux 9.0 [Release OL7 to OL9]

Linux x86_64 on Oracle Public Cloud

Goal:

Remove Java versions completely from Oracle Linux instances.

Solution:

To Remove Java package from an Oracle Linux System(other versions of Java may still be present on the system), follow the steps below:

  • Find the Java package:
# rpm -qa | grep jdk
  • Remove the Java package (retrieved from the previous command output):
Example)
# yum remove jdk-11-11.0.18-9.x86_64
  • Delete symbolic links with the update-alternatives command.
# update-alternatives --remove "java" "/usr/lib/jvm/jdk[version]/bin/java"

Examples)
# update-alternatives --remove "java" "/usr/lib/jvm/jdk-11-oracle-x64/bin/java"
# update-alternatives --remove "javac" "/usr/lib/jvm/jdk-11-oracle-x64/bin/javac"
# update-alternatives --remove "javaws" "/usr/lib/jvm/jdk-11-oracle-x64/bin/javaws"

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!