troubleshooting Question

JRE version on RHEL

Avatar of RfromP
RfromP asked on
LinuxLinux Distributions
17 Comments2 Solutions836 ViewsLast Modified:
Let me preface by saying I am not proficient with the command line in RHEL but my goal is to learn more as to become more competent and efficient with the terminal. I am lucky to have an employer who allows me to work in my job, which requires extensive use of the CLI in RHEL, while still learning its usage. Having said that, I'm not a complete novice and I do a considerable amount of "googling" to expand my knowledge but when it comes to work, I am required to perform advanced CLI techniques to keep our systems performing and I don't always have the opportunity to take the time to do the thorough research necessary to fully comprehend the commands, but at the same time I don't willy-nilly around on the CLI of our production systems. I keep a MacBook Pro on my desk in which I run VirtualBox and a RHEL 6.3 64bit VM to "rehearse" the commands I intend to run on our production systems. With the guidance of my CLI Guru supervisor, I often input advanced CLI commands as necessary but without a complete appreciation of what the command is telling the OS to do. My sup is a very busy individual and I am able to, now and again, "pick" his brain to further my knowledge but he's not always available and the bottom line is that I'm expected to perform and I am eager to absorb as much information from anyone who is willing to help me here, so I'd like to thank you, in advance, for your patience and willingness to coach me long in my endeavors to become more RHEL CLI capable.

Background info:
OS - RHEL 6.3 64bit as a VM on VirtualBox.

I'm confused on what RHEL is telling me about the JRE it is using
The research I've done indicates to
java -version

Open in new window

to check which version of the JRE RHEL is using. Here's the output:
[tex@localhost ~]$ java -version
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.1) (rhel-
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
[tex@localhost ~]$

Open in new window

It's telling me the java version is 1.6.0_24. What I'm really trying to find out is the jre version, for instance Java 7 Update 21.

I googled and found this:
rpm -qa | grep jre

Open in new window

which puts out this:
[tex@localhost ~]$ jre-1.7.0_21-fcs.x86_64

Open in new window

From what I read, the command above "confirms the jre version against the rpm database".

For my purposes, I am more interested in the jre version due to the security requirements of the network.

My Questions:
1. Is there a more appropriate command to find which jre the system is using?
2. The second command (rpm -qa | grep jre) which "confirms the jre version against the rpm database". Does that signify the jre version that the system is currently using?

Aside Questions:
1. I did:
[tex@localhost ~]$ java -version > /home/tex/Documents/java

Open in new window

the output was echoed to the screen and the file was created but when I "catted" the file it was blank. So as a test I did
[tex@localhost ~]$ cat /etc/hosts > /home/tex/Documents/java

Open in new window

the output didn't echo to the screen but it did place it in the file. So then I again do
[tex@localhost ~]$ java -version > /home/tex/Documents/java

Open in new window

the output echoes to the screen and the hosts information from the previous command is replaced as expected, but it is replaced with nothing, the file is blank. Is there some reason the java -version command won't write the output to a file?

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 17 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 17 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros