What are the options for Java installed through RPM?


This article applies to:
  • Platform(s): Red Hat Linux, SUSE Linux, Oracle Linux, Oracle Enterprise Linux, SLES
  • Java version(s): 7.0, 8.0

This page answers most frequently asked questions about installing Java on Linux using RPM method.
 
Was my version of Java installed with RPM?
The RPM database can be queried to determine what packages have been installed. This command will try to locate any Java installed on the system.
  • Open new Terminal Window
  • Type: rpm -q --list jre | grep "bin/java"
Note: If a version of Java is installed on the system, but is not listed by the RPM query, then it is not an RPM installation.

 
How do I upgrade Java using RPM?
The recommended method of upgrading Java using RPM is to use the upgrade option.
For example:
  • Open new Terminal Window
  • Type: rpm -Uvh <package-file>
    For example: for upgrade to Java 1.7.0, type: rpm -Uvh jre1.7.0
The vh options are used to provide the user with feedback during the installation process.

 
If I have two versions of Java on my machine running through RPM, how do I remove one of them?
To uninstall a RPM installation, you need to know the package’s full name, version number, and release names.
Determine installed versions of Java
  • Open new Terminal Window
  • Type: rpm -q jre
    Note: Sample results returned by above query
    jre-1.5.0
    jre-1.6.0_07
  • To uninstall 1.5.0, type: rpm -e jre-1.5.0