find rpm name from a executable

I am using redhat 6.5. By default JRE is installed with this OS. I want to find the rpm name of the jre installed in my machine.
ie) input should be executable and the output will be the rpm name

which java

/usr/bin/java

expected output:

command to find the rpm name.

jre-1.7.0_80-fcs.x86_64

here java –version shows version 1.5. But i want to use oracle jre instead of the default one. After installing oracle jre still the default version of jres is used but i want to remove the default version of jre from OS.

Any help will be appreciated.


Source: linux

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.