Why alternatives path is not updating upon removal or update of java?

Solution Verified - Updated -

Issue

  • Updating java does not update the alternatives link.
# rpm -q java-1.8.0-openjdk
java-1.8.0-openjdk-1.8.0.65-0.b17.el6_7.x86_64

# yum update java-1.8.0-openjdk

# ls -l /etc/alternatives/jre
lrwxrwxrwx. 1 root root 63 Mar 17 17:02 /etc/alternatives/jre -> /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.65-0.b17.el6_7.x86_64/jre
  • Removing java package does not update the alternatives link, it remains stale.
root> rpm -ivh java-1.5.0-gcj-1.5.0.0-29.1.el6.x86_64.rpm 
Preparing...                ########################################### [100%]
  1:java-1.5.0-gcj         ########################################### [100%]

root> ls -lrt /etc/alternatives/java
lrwxrwxrwx. 1 root root 35 Jun 17 06:59 /etc/alternatives/java -> /usr/lib/jvm/jre-1.5.0-gcj/bin/java


root> rpm -ivh java-1.8.0-openjdk-1.8.0.20-3.b26.el6.x86_64.rpm 
Preparing...                ########################################### [100%]
  1:java-1.8.0-openjdk     ########################################### [100%]

Environment

  • Red Hat Enterprise Linux 6
  • chkconfig-1.3.49.3-2
  • Oracle java
  • OpenJDK java

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.