LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-21-2003, 04:22 PM   #1
AfterBurn
LQ Newbie
 
Registered: Oct 2003
Distribution: Red Hat 9
Posts: 24

Rep: Reputation: 15
Java stuck


ok here is what happened. I went to install LimeWire. well i needed Java. i downloaded jre1.3.1 and installed it. i did everything and i kept getting errors. so i decided to upgrade to 1.4.1 and downloaded j2re1.4.1 well i went to uninstall 1.3.1 and it said it wasn't installed. so i gave up and installed 1.4.1 and i changed my java.sh. problem is that now there is both jre1.3.1 and j2re1.4.1 directories on my system and my "java -version" gives me this:
[root@localhost steve]# java -version
java version "1.3.1"
jdkgcj 0.2.3 (URL HERE BUT I CANT POST IT CUZ IM A n00b)
gcj (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

i have tried doing everything i can to yank 1.3.1 and add 1.4.1 including forced upgradedes and the whole nine yards. Im running RH9 with 2.4.20-8 kernel. any ideas what i can do?
 
Old 10-21-2003, 04:36 PM   #2
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
Download the official J2SDK (J2SE) for Linux from java.sun.com. The current version is 1.4.2_02. There are instructions for installing it on the Javasoft website and Java installation questions are posted in these forums daily. Use the search function here and you will find a lot of useful posts.

Håkan
 
Old 10-21-2003, 04:49 PM   #3
AfterBurn
LQ Newbie
 
Registered: Oct 2003
Distribution: Red Hat 9
Posts: 24

Original Poster
Rep: Reputation: 15
tried that

i've tried them all and my problem is when that it once i install it, it says its not there, and i cant write over the 1.3.1 files and i cant yank the 1.3.1 i've tried rpm -e rpm --force (install and upgrade) all combos just dont work. is there some way to manually delete all the files and yank it like you can to some things in windows?
 
Old 10-21-2003, 06:24 PM   #4
kc8tbe
Member
 
Registered: Feb 2003
Location: Cleveland, Ohio (USA)
Distribution: Gentoo, Kubuntu 6.06
Posts: 179

Rep: Reputation: 30
I'm a little confused...

What distro are you running? Some distro's have a utility that lets you run more than one Java VM at once (for example, java-config on Gentoo). It is possible that you need to configure such a program to recognize your jre before you can use the jre.

Also, while Sun's JRE is probably the fastest out there for Linux, some apps - such as OpenOffice, prefer Blackdown - an open source alternative.
 
Old 10-21-2003, 06:31 PM   #5
AfterBurn
LQ Newbie
 
Registered: Oct 2003
Distribution: Red Hat 9
Posts: 24

Original Poster
Rep: Reputation: 15
im running RedHat version 9 and i have a pretty slow system so faster is better lol but if u have any suggestions plz say so. i think what happened is that the 1.3.1 install got whacked because 1.3.1 never worked. it cant find the compiler and interpiter and 1.4.1 cant either, even when i change the java.sh and reenter everything in terminal. im sorta a noob at this stuff and im wondering if their are alternatives to having to reload the entire system because that would b a MAJOR pain. thx all
 
Old 10-21-2003, 06:40 PM   #6
kc8tbe
Member
 
Registered: Feb 2003
Location: Cleveland, Ohio (USA)
Distribution: Gentoo, Kubuntu 6.06
Posts: 179

Rep: Reputation: 30
Its been a while since I've used RedHat, but...

Doesn't RedHat have an rpm for Java VM?
Of course not - at least not for SUN, because that would require lisencing and RedHat doesn't even play mp3's by default.

But there might be an unofficial RH rpm to suit your need on apt. Please tell me that you know what apt is.
 
Old 10-21-2003, 06:50 PM   #7
AfterBurn
LQ Newbie
 
Registered: Oct 2003
Distribution: Red Hat 9
Posts: 24

Original Poster
Rep: Reputation: 15
i shall look. isnt apt debian's version of rpm or visa versa? i've read it before but never used debian so i have not delt with it. if you mean something else please let me know.
 
Old 10-21-2003, 07:01 PM   #8
kc8tbe
Member
 
Registered: Feb 2003
Location: Cleveland, Ohio (USA)
Distribution: Gentoo, Kubuntu 6.06
Posts: 179

Rep: Reputation: 30
Apt is the "open source" version of RedHat's update daemon. Rather than downloading RedHat's rpm's from RedHat's ftp servers, users can download the same rpm's from faster repositories like freshmeat and rpmfind. Apt repositories don't require you to pay money or get on some annoying mailing list. They also contain tested, stable rpm's that other users have uploaded (just be sure that you use legitimate repositories). Apt will solve dependencies for you and allow you to automatically download and install any rpm's that go with the rpm you needed. Apt will also search repositories for you and tell you what packages need updating.

Apt has a command-line interface (apt-get) and a gui (synaptic) both of which I found easy to use. Just download apt-get from a site like rpmfind.net, run "apt-get synaptic", fire up synaptic, and you're in business!

To go back to your earlier question, yes; apt is used by Debian, Connectiva, Mandrake, and numerous other distro's for that matter. There is apt out there specifically for RedHat, and if there is an rpm out there for Java VM, it's probably on apt.
 
Old 10-21-2003, 08:30 PM   #9
chakkerz
Member
 
Registered: Dec 2002
Location: Brisbane, Australia
Distribution: RedHat (RHEL, FC, CentOS), openSuSE, Mac OS X
Posts: 653

Rep: Reputation: 32
Alright
- get the selfextracting bin file from java.sun.com

- extract it

- copy the subdirectory you got after extraction to /usr/ (probably resulting in /usr/j2sdk1.4.2/ )

- symlink (ln -s) java javac from /usr/j2sdk1.4.2/bin/ to /usr/bin/
ie cd /usr/j2sdk1.4.2/bin
ln -s java /usr/bin
ln -s javac /usr/bin
(the first is java so you can run java applications, the second is a java compiler, you might not need it ... there are other tools there, add them if you need them)

- type java -version to check you are getting the right thing, something like:
root@stormcrow:/home/chakkerz# java -version
java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28)
Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed mode)


IF you get an error regarding a library not being found, the lib file is in /usr/j2sdk1.4.2/jre/lib/i386
- either ldconfig from there, or
- copy it to /usr/lib/ whatever makes you happiest.

either way you will need to run ldconfig - a handy option might be to do it this way:
ldconfig --verbose | grep libjava
may be a good idea, cause it lets you know that the lib was added (if it was):
root@stormcrow:/usr/lib# ldconfig --verbose | grep libjava
libjava.so -> libjava.so
you might see stuff similar to this:
ldconfig: Can't stat /usr/i386-slackware-linux/lib: No such file or directory
ldconfig: Can't stat /usr/j2sdk1.4.1_03/jre/lib/i386: No such file or directory
which might be a carry over from your previous attempts, don't let it phase you too much.

PS.: you need to be root to add things to /usr on most systems, you need to be root to add things /usr/bin and /usr/lib, you need to be root to run ldconfig, so consider doing this as ... (you guessed it) root.

Last edited by chakkerz; 10-21-2003 at 08:32 PM.
 
Old 10-22-2003, 06:31 PM   #10
AfterBurn
LQ Newbie
 
Registered: Oct 2003
Distribution: Red Hat 9
Posts: 24

Original Poster
Rep: Reputation: 15
[root@localhost /]# java -version
bash: /usr/bin/java: Too many levels of symbolic links
thats the error i get now
my java path is: /usr/java/j2re1.4.1_05/bin
is that the problem?
 
Old 10-22-2003, 10:01 PM   #11
chakkerz
Member
 
Registered: Dec 2002
Location: Brisbane, Australia
Distribution: RedHat (RHEL, FC, CentOS), openSuSE, Mac OS X
Posts: 653

Rep: Reputation: 32
hmm interesting. try deleting the java link in /usr/bin/ and redoing it.

Another thing to check, while you're at it, is go into /usr/java/j2re1.4.1_05/bin and run ./java -version and see if that works. Another thing you might want to do (i've just checked mine) is that if the symbolic link doesn't work, instead of ln -s use a straight cp and copy it to /usr/bin ... it shouldn't make any difference, but it might be worth a shot. I've actually got copies here at the moment, though i've used symlinks in the past i'm sure.

Oh one last thing. Check that /usr/java is not actually a symlink. just go into /usr/java and see if there actually is a subdirectory in there for JRE. I've had that throw me in the early days. I (think, i) tried symlinking through a symlink and it didn't look upon it too favourably.
 
Old 10-22-2003, 10:23 PM   #12
AfterBurn
LQ Newbie
 
Registered: Oct 2003
Distribution: Red Hat 9
Posts: 24

Original Poster
Rep: Reputation: 15
ok i tried ur thing and doing some nasty work i ended up deleting 1.3.1 and upgrading to 1.4.1 i had to remove the orignial java symlink and do this: ln -f -s /usr/java/j2re1.4.1_05 /usr/bin thx for all the help. i now have java working and im onto my next problem of getting limewire to use a proxy but thats a subject for another post lol
 
Old 10-23-2003, 08:05 AM   #13
chakkerz
Member
 
Registered: Dec 2002
Location: Brisbane, Australia
Distribution: RedHat (RHEL, FC, CentOS), openSuSE, Mac OS X
Posts: 653

Rep: Reputation: 32
great to hear. Good luck with the other problem
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Java plugin installed correctly for Firefox but not able to view any java applet tvn Linux - Software 10 04-15-2010 03:13 AM
Java Programming: Java Runtime Environment not found when trying to compile murbz Linux - Software 2 03-26-2009 04:04 AM
Problems with Java Web Start (java 1.4.2 - 1.5.0) on Slackware Egy Slackware 11 05-10-2005 07:30 AM
Web start java not working (java works fine) powadha Debian 5 06-05-2004 01:57 PM
2 Questions: java calling system commands? PERL vs Java? randomx Programming 28 11-28-2003 09:24 PM


All times are GMT -5. The time now is 09:08 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration