LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-23-2010, 03:10 AM   #1
udaya31
LQ Newbie
 
Registered: Feb 2010
Posts: 13

Rep: Reputation: Disabled
Smile JAVA installation error


I installed the java file i.e "jdk-6u18-linux-i586". And it is installed without an error. But when I execute the command "java -version" it doesn't show the above version, it shows the previous version which I installed during the installation of redhat enterprise linux server 5.

So, what is the problem guys?

Please, help me.

Thanks!
 
Old 02-23-2010, 03:30 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

When you ran the installation sciprt jdk-6u18-linux-i586.bn, it created a directory jdk1.6.0_18.
You must run java from this directory in order to use the new version, or change the PATH variable and add the complete path to the above directory first:
Code:
export PATH=/complete/path/to/jdk1.6.0_18/bin:$PATH
Regards
 
Old 02-23-2010, 10:48 AM   #3
zeroquaranta
LQ Newbie
 
Registered: Feb 2010
Posts: 22

Rep: Reputation: 0
Question

Hello,

I'm also facing some problems with Java installation.
I got a Red Hat Linux Enterprise 5.3 on an Intel 64 bit system.
Typing "java -version" I get

java version "1.4.2"
gij (GNU libgcj) version 4.1.2 20080704 (Red Hat 4.1.2-44)


meaning that some Java RE version is already installed.
I need to install the JRE 1.6 update 10 (not the latest).
After some googling, the best I found is jre-6u10-linux-amd64.rpm (extracted from jre-6u10-linux-x64-rpm.bin).
I'm not sure whether this rpm is suitable for an Intel-based system (I see 'amd' in the name)?
I tried to install it anyway (rpm -ivh ...), got this:


Preparing... ########################################### [100%]
1:jre ########################################### [100%]
Unpacking JAR files...
rt.jar...
jsse.jar...
charsets.jar...
localedata.jar...


but nothing seems to have changed (same java version, no new directory created).

Any hint?

tH
 
Old 02-23-2010, 05:00 PM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
@zeroquaranta
Before anything else check /usr/java/ to see if latest is already installed. In that case just change your PATH:
Code:
export PATH=/usr/java/default/bin:$PATH
Otherwise there should be a jre-6u10-linux-x64-rpm in the place where you ran jre-6u10-linux-x64-rpm.bin. Use rpm to install:
Code:
rpm -ivh jre-6u10-linux-x64-rpm
 
Old 02-24-2010, 02:37 AM   #5
zeroquaranta
LQ Newbie
 
Registered: Feb 2010
Posts: 22

Rep: Reputation: 0
Hi bathory,

I actually got the dir /usr/java/jre1.6.0_10 meaning that the rpm installation I did sorted out something.
And when I move on that directory and type './java --version' I get

java version "1.6.0_10"
Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
Java HotSpot(TM) 64-Bit Server VM (build 11.0-b15, mixed mode)


as wished.
Now, I think 2 versions are installed on the system, I only need to arrange the PATH variable in order to have the new version launched when I type "java" from whatever directory.

As for the rpm thing, I actually got one after the execution of the .bin file. The thing is that the names are different

jre-6u10-linux-x64-rpm.bin -> jre-6u10-linux-amd64.rpm

and, since I see 'amd64', I'm wondering whether it is suitable for my Intel-based server.

Thanks a lot.

Last edited by zeroquaranta; 02-24-2010 at 03:06 AM.
 
Old 02-24-2010, 03:02 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

In java.sun.com now there is only jre-6u18-linux-x64-rpm.bin (maybe jre-6u10-linux-amd64.rpm was the name for previous versions)
You can check your installed version with:
Code:
rpm -qa|grep jre
and maybe upgrade to the last version

Regards
 
Old 02-24-2010, 03:05 AM   #7
zeroquaranta
LQ Newbie
 
Registered: Feb 2010
Posts: 22

Rep: Reputation: 0
Ok, forget the PATH thing, I followed your instructions and now it seems that the new version is recognized ('java -version' from anywhere).
 
Old 02-24-2010, 03:17 AM   #8
zeroquaranta
LQ Newbie
 
Registered: Feb 2010
Posts: 22

Rep: Reputation: 0
Arrow

Ok,
Code:
rpm -qa|grep jre
returns
Code:
jre-1.6.0_10-fcs
which looks good.

As I wrote, I just need the "update 10", not the latest one; thus grabbed
jre-6u10-linux-x64-rpm.bin
from the Sun website. But when I run it I get
jre-6u10-linux-amd64.rpm
which is the one I installed.
 
Old 02-24-2010, 03:40 AM   #9
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
You should better use a package made for RHEL based systems, so you can upgrade. You can get the correct package from here.
And I guess you have to uninstall the 32bit version prior installing the 64bit
 
Old 02-24-2010, 07:40 AM   #10
zeroquaranta
LQ Newbie
 
Registered: Feb 2010
Posts: 22

Rep: Reputation: 0
Ok, via the link you posted I found this

jdk-1.6.0_14-fcs.x86_64.rpm

which is exactly (apart from the update version) what I see in the Gnome Packages Manager, in the installed packages list (jre-1.6.0_10-fcs.x86_64).
At this point I'm not sure why the rpm I downloaded from Sun website has a 'amd64' in it.
I'm gonna try and see if it works, anyway.
Thanks a lot! I.O.U a beer!

PS: as for the previous installed version, which came with Red Hat, it appears in the same installed packages list as
java-1.4.2-gcj-compat-1.4.2.0-40jpp.115.x86_64; I didn't uninstalled it, gonna see if it causes any problem

Last edited by zeroquaranta; 02-24-2010 at 08:45 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Runtime.getRuntime().exec("cd") returns java.io.IOException, error 2 in java tatarin Programming 4 03-28-2008 07:42 PM
Java + Netbeans installation error tm2383 Linux - Software 1 12-23-2007 08:04 AM
Java-GTK glib-java-0.2.5 Error hikkerguy Linux - Software 2 07-19-2006 06:01 PM
JAVA JRE installation to view java applet through browser dipenchaudhary Linux - Software 1 01-23-2006 09:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration