Link to home
Start Free TrialLog in
Avatar of RfromP
RfromP

asked on

JRE version on RHEL

Hello,
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-1.45.1.11.1.el6-x86_64)
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?
Avatar of Darr247
Darr247
Flag of United States of America image

> 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.
In that format 1.6.0_24 would be expressed as Java 6 Update 24.
If you want 1.7.0_25 RPMs that will install in RHEL with yum, download
http://javadl.sun.com/webapps/download/AutoDL?BundleId=78696 (64 bit) and
http://javadl.sun.com/webapps/download/AutoDL?BundleId=78694 (32 bit) from
http://java.com/en/download/manual.jsp#lin
Avatar of RfromP
RfromP

ASKER

In that format 1.6.0_24 would be expressed as Java 6 Update 24.

So you are saying my system is using jre 6 update 24?

Then why when I
[tex@localhost ~]$rpm -qa | grep jre

Open in new window

does it return?
[tex@localhost ~]$ jre-1.7.0_21-fcs.x86_64

Open in new window


Seems like two different things to me because the numbers are different, i.e. 6_24 vs. 7_21. I'm guessing the first returned the jdk version and the second returned the jre version.

Thank you but I'm still not clear on this.
SOLUTION
Avatar of deviprasad_s
deviprasad_s
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RfromP

ASKER

Thank you deviprasad_s for your reply.

So based on the pictures you attached you are using JRE version 1.7.0.9

That seems like a really old version of the JRE because the version that's out now is at least 7 Update 25. I'm a little confused.

I should restate my circumstance and question.

The problem I'm trying to solve is this:

My IT department periodically runs a scan of our systems and they told me the JRE on my RHEL systms needs updated.

I want to be sure I update the JRE and remove any old versions so when the IT Dept. scans again, my systems will be compliant.

Question still open. Thanks for any input.
dear,

different companies provide the jdks , for our use. some of them are  

oracle  

http://www.oracle.com/technetwork/java/javase/downloads/index.html

openjdk .--

http://openjdk.java.net/install/index.html

IBM JDK --
http://www.ibm.com/developerworks/java/jdk/

and all of them can be installed on the system at a time , and also there can be multiple version of java from the same company exist onthe system at the same time .


so my version of java is latest and its from open-source jdk .

so this solves your first question

the problem to your questiion is simple :

go to the site :

you can allow verify the java -version online from java site 

http://www.java.com/en/download/installed.jsp --
http://java.com/en/download/testjava.jsp

and it will tell you ,if you are using the latest versiono f java and if not give the option of updating the java to latest version

hope this solves problem.


you can allow verify the java -version online from java site 

for further clarifications of doubts :

note here:

To find out if the java executable is in your PATH, execute:
% java -version

To find out which java executable the first one found in your PATH, execute:
% which java
hope this gives some help to you 

thanks,
s.deviprasad
Avatar of RfromP

ASKER

Thank you s.deviprasad for your reply.

Unfortunately, my network is closed and does not access the internet in any way, nor can it be allowed. That is why I'm trying to understand how to do this operation manually.

Question still open. Thanks for any input.
dear,

if you dont have internet ,nor access to the network, then

follow my post , above :
1. the steps are simple :
1. find the package onthe system which gives the jdk onthe system.
sol: query the rpm base by using the command

#rpm -qa |grep jdk
it  will give the jdk version ...

match it up with the .version number shown in the
#java -version

2. find where this jdk.rpm places files inthe system .i,e jre .

issue the command

#rpm -qli xyz.jdk.rpm  |more

it will list where in the path that jdk has put java on the system.

you will get to see version of jre on the system.

3.if it is not the current version i.e jese 7 update 25 from the oracle company .

4. if have downloaded the jdk 7 update 25 installer form the oracle .com
and placed it in the system .
5.run the installer going to the path
6.it will install the latest java7 se update 25

if it does not help ,we will assit you
thanks ,
s.deviprasad
Avatar of RfromP

ASKER

Thanks s.deviprasad, but you keep saying JDK. I'm not referring to the JDK, I need the JRE updated, not JDK. Maybe I misunderstand but they are different. JDK - JRE

I don't have access to the scan results at this time but I will try to get them so I can show.

Question still open.
dear,

here is the process of installing the jre for your computer ,latest one .

I was refereing to jdk because , jre comes inside the jdk .

so when you install jdk, you are also installing the jre .

anyhow ,
youjust want to install the jre not jdk ,
then follow the vedio attachment .

hope this helps

thanks,
s.deviprasad
javainstall.flv
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
dear,

I have shown the method where in you dont need to remove the old jre ,

and still get working new jre .

multiple jre in system dont create any problem

thanks,
s.deviprasad
> multiple jre in system dont create any problem

While that's true, if the asker installs 1.7.x without removing 1.6.x, I'm assuming their IT Department will see the 1.6 build installed and tell them their java still needs updating.
dear,
Inmy installation steps , i have installed java 1.7 u25 in such a way that , if youe ,I tdeparment scans also ,it will detect java 1.7 u25 .

thanks,
s.deviprasad
Nevertheless, that is the concern the poster implied in http:#a39343457
darr247,

you are quite correct in pointing out the authers concern,

the fact is that , it is not a good idea ot completely remove the old version of java ,just because an update has come up .

we should use the latest versionof java update for some time ,may be after some time ,we can remove it .

thanks,
s.deviprasad
Java 7 is supposed to be fully backwards compatible with Java 6.
dear,
you are right java7 is suppposed to be backward compatible with java 6 ,

the matter of the fact is that ,
in your system some application use java6 internaet exploreo uses one java version ,
and so on

some use oracle java for optimized performance
some use openjdk jre .

so when eer an update comes , make sure that all apps run on the updated jre ,for some time,
once you are sure you dont need old java , delete the form the system
java old version or new version , its just a virtual machine .....
we can have as many virtual machines as possible ..use them and then junk them bu deleting them later.

thanks ,
s.deviprasad