Fedora Linux Support Community & Resources Center
  #1  
Old 3rd February 2007, 07:18 PM
axiopisty Offline
Registered User
 
Join Date: Jan 2006
Location: Utah, USA
Posts: 59
Uninstall/Install Java

Hello, I am running FC6 and having problems with Java. I previously installed jdk6 but must not have done it properly, so I am trying to do it again.

I am in su - mode. I downloaded jdk-6-linux-i586-rpm.bin and put it in /opt/ Then I did these commands

cd /opt
chmod +x jdk-6-linux-i586-rpm.bin
./jdk-6-linux-i586-rpm.bin

Then:

[root@localhost opt]# rpm -iv jdk-6-linux-i586.rpm
Preparing packages for installation...
package jdk-1.6.0-fcs is already installed
[root@localhost opt]# java -version
java version "1.4.2"
gij (GNU libgcj) version 4.1.1 20070105 (Red Hat 4.1.1-51)

Copyright (C) 2006 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.
[root@localhost opt]#

So, I don't know what is wrong. It says that 1.6.0 is already installed, but it is using 1.4..2.

I would like to uninstall all versions of Java on my machine and just start from scratch with a clean install of java 6. But I don't know how to do that.

Will you help me?
Thanks.
Reply With Quote
  #2  
Old 3rd February 2007, 07:29 PM
strategyoracle Offline
Registered User
 
Join Date: Feb 2007
Location: Hampshire, UK
Age: 24
Posts: 7
Try doing this:

Code:
# yum remove libgcj
That should remove the old Java leaving only the new Java and (in theory) it should work.

EDIT: actually this might be a bad idea, as it will take down OOo and anything else that depends on it.
Reply With Quote
  #3  
Old 3rd February 2007, 07:33 PM
strategyoracle Offline
Registered User
 
Join Date: Feb 2007
Location: Hampshire, UK
Age: 24
Posts: 7
I recommend doing the following instead:

Get the non-RPM version of Sun Java, and move it to opt, chmod it and run it just like you did there (without the rpm step).

Then add this to bottom of the file called .bashrc in your home folder:

Code:
export PATH=/opt/jre-versionnumber/bin:${PATH}
(Replacing jre-versionnumber with the name of the folder it creates in /opt)

That's how mine is set up at the moment and it works for me.

Hope this helps.
Reply With Quote
  #4  
Old 3rd February 2007, 07:43 PM
ionutv202003 Offline
Registered User
 
Join Date: Apr 2005
Location: romania
Age: 31
Posts: 100
you do not have to unistall all jdks on the machine. this is how it works:

when you install the linux system you have integrated suport for java. this is ths gij you see when you type "java -version".

when you installed JDK6 it is most possible that the path to it was not exported.

what you have to do:

first go to the path where you installed the JDK6 and change directory there to subfolder bin/
type "./java" to check if it works. if it releases an output it means it is ok. to check it's verson type "./java -version". note that "./" are mandatory for the shell to run the executable from the folder you are in (that is tha subfolder bin of you JDK6 installation) not the one from /usr/bin

second you need to make it be your "default" java command. for this you have to do the following:

1.go to your home directory and open for editing file ".bash_profile". at the end of the file add this:

export PATH=<path/to/jdk6/bin>:$PATH

(<path/to/jdk6/bin> is te path to the bin subfolder of your JDK6 insatallation)

2.save file and exit

3.note that the path is not exported until you open a new terminal (restart the destop manager or the system)

4.you're good to go

troubleshooting: if when you type java you still get the old output do this:

env | grep PATH

the output is the value for environment variable PATH. the first path should be the path to subfolder bin of your JDK6 installlation. If not so, you slipped something from what i said or something went wrong. recheck that you did all the steps from above.
Reply With Quote
  #5  
Old 3rd February 2007, 07:43 PM
axiopisty Offline
Registered User
 
Join Date: Jan 2006
Location: Utah, USA
Posts: 59
Thanks for your replies. I really appreciate them. But I continued to work on this problem before getting the replies. This is what I did.

yum remove java
yum remove jdk-1.6.0-fcs
cd /opt
[root@localhost opt]# rpm -iv jdk-6-linux-i586.rpm
[root@localhost opt]$ java -version
java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)
[root@localhost opt]$

So it looks like this worked!

Now, when I list the directory content, I do not see a java directory. So now my question is, How do I install the java plugin into my firefox web browser?
Reply With Quote
  #6  
Old 3rd February 2007, 07:44 PM
ionutv202003 Offline
Registered User
 
Join Date: Apr 2005
Location: romania
Age: 31
Posts: 100
P.S.: i do not recomand to unistall the java which comes with the system install. it can stay there without doing any harm. you may risck to break something.
Reply With Quote
  #7  
Old 3rd February 2007, 07:47 PM
axiopisty Offline
Registered User
 
Join Date: Jan 2006
Location: Utah, USA
Posts: 59
Thanks to everyone who participated in this thread. ionutv202003 special thanks to you for the command env |grep PATH. I think that is all the help that I needed to find where the jre/plugin directory was at to be able to install the plugin for the web browser... now that I know where that is I can create the sym link.

Thanks!

PS. I love FedoraForum.org. You get the answers you're looking for fast!
Reply With Quote
  #8  
Old 5th February 2007, 06:50 PM
nmr_fedora Offline
Registered User
 
Join Date: Jan 2007
Posts: 6
I just install the jdk6. when I open a new terminal, they told me "export: Command not found.".
I use C-shell
Reply With Quote
  #9  
Old 6th February 2007, 09:42 AM
ionutv202003 Offline
Registered User
 
Join Date: Apr 2005
Location: romania
Age: 31
Posts: 100
I use bash. I do not know the command to export in C-shell.
Reply With Quote
  #10  
Old 6th February 2007, 09:46 AM
strategyoracle Offline
Registered User
 
Join Date: Feb 2007
Location: Hampshire, UK
Age: 24
Posts: 7
Try setenv instead of export.
Reply With Quote
  #11  
Old 8th February 2007, 02:23 PM
nmr_fedora Offline
Registered User
 
Join Date: Jan 2007
Posts: 6
I tried setenv instead of export, then all the command s did not work, like ls,cd ...
Reply With Quote
  #12  
Old 8th February 2007, 07:34 PM
ionutv202003 Offline
Registered User
 
Join Date: Apr 2005
Location: romania
Age: 31
Posts: 100
It may be that you replaced the value of the PATH variable. make sure you do not replace current value with the value that you want to add. so you have to append the value you want to the PATH variable. you must have something like: export PATH=<path/to/jdk6/bin>:$PATH. as you can see you have to append to the current value of variable PATH ($PATH) the path to your JDK installation (<path/to/jdk6/bin>). most possible you erased the current value if commands like ls are not working.
Reply With Quote
Reply

Tags
java, uninstall or install

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I uninstall after a bad install ? OralDeckard Using Fedora 0 24th June 2009 01:22 PM
cant install/uninstall anything nightsight Using Fedora 4 2nd May 2009 09:31 PM
How to uninstall yum and install yum again? sandwich Using Fedora 8 16th November 2007 01:54 PM
Uninstall Java babak1 Using Fedora 4 19th August 2005 12:41 AM
Java Woes - Req How to uninstall Java Alfred Using Fedora 10 5th March 2005 06:09 PM


Current GMT-time: 06:59 (Wednesday, 23-04-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat