LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 06-03-2007, 05:33 PM   #1
Ordinary12
Member
 
Registered: Feb 2007
Posts: 140

Rep: Reputation: 15
$20 for a working JAVA!!!!


I followed the following directions exactly, with a few modifications for the newer version of Java but I still couldn't get it to work. Can someone please tell me what I'm doing wring?

OK, here you go...........



Reconfiguring the default Java configuration for Red Hat / Fedora



This is done as root or equivalent.



First remove /var/lib/alternatives/java file by typing;



rm /var/lib/alternatives/java



When asked press the 'y' key,



Now to create the new (corrected) alternatives file for java type

the following commands as root;



/usr/sbin/alternatives --install /usr/bin/java java /usr/lib/jvm/jre-1.4.2-gcj/bin/java 1



For jre:



/usr/sbin/alternatives --install /usr/bin/java java /usr/java/jre1.6.0/bin/java 2



For jdk:



/usr/sbin/alternatives --install /usr/bin/java java /usr/java/jdk1.6.0_01/jre/bin/java 2



/usr/sbin/alternatives --config java



You should now see for example:



There are 2 programs which provide 'java'.



Selection Command

-----------------------------------------------

1 /usr/lib/jvm/jre-1.4.2-gcj/bin/java

*+ 2 /usr/java/jre1.6.0/bin/java



Enter to keep the current selection[+], or type selection number:



Type: <choose 1 or 2>



In the example above java is already configured correctly [*+ 2] to

use Sun's Java, no changes are needed, just press the Enter key here.

If you have been following the instructions then you should have

the same results (version numbers may be sightly different).



Now type; /usr/sbin/alternatives --display java



You should see for example;



java - status is manual.

link currently points to /usr/java/jre1.6.0/bin/java

/usr/lib/jvm/jre-1.4.2-gcj/bin/java - priority 1

/usr/java/jre1.6.0/bin/java - priority 2

Current `best' version is /usr/java/jre1.6.0/bin/java.



Next you might want to create (or edit) /etc/profile.d/java.sh

file, examples below:



For jre;



export JAVA_HOME="/usr/java/jre1.6.0/bin"

export JAVA_PATH="$JAVA_HOME"

export PATH="$PATH:$JAVA_HOME"



For jdk;



export JAVA_HOME="/usr/java/jdk1.6.0_01/jre/bin"

export JAVA_PATH="$JAVA_HOME"

export PATH="$PATH:$JAVA_HOME"





When done creating or editing the file type;



source /etc/profile.d/java.sh



Now any user root or other wise should be able to use the command;



which java



and the results should read something like;



/usr/bin/java



Also any user root or other wize should be able to use the command;



java -version



and the results should read something like;



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)



That's it, all done.



See not that hard to change.

This is my Java file.

export JAVA_HOME="/usr/java/jdk1.6.0_01/jre/bin"

export JAVA_PATH="$JAVA_HOME"

export PATH="$PATH:$JAVA_HOME"


export JAVA_HOME="/usr/java/jre1.6.0/bin"

export JAVA_PATH="$JAVA_HOME"

export PATH="$PATH:$JAVA_HOME"
 
Old 06-03-2007, 06:51 PM   #2
puntjuh
Member
 
Registered: Apr 2006
Location: holland
Distribution: Gentoo / debian / suse / mint
Posts: 558

Rep: Reputation: 42
Might i suggest just downloading the one from the sun site, and install the RPM ? Or the .src.bin .. and install it that way, this way is long, and probably unneeded.

HERE
 
Old 06-04-2007, 01:40 AM   #3
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 131Reputation: 131
Quote:
First remove /var/lib/alternatives/java
I never had to do this - it works fine, though.

Quote:
/usr/sbin/alternatives --install /usr/bin/java java /usr/lib/jvm/jre-1.4.2-gcj/bin/java 1
I didn't have to do this either - the system was already set up to have this one.

Quote:
/usr/sbin/alternatives --install /usr/bin/java java /usr/java/jdk1.6.0_01/jre/bin/java 2
This assumes that your java is in the /usr/java directory - that is correct only if you used the java.rpm.bin - if you used the java.bin instead (which you need to extract and move around yourself), it is not unless you explicityly placed the extracted folder it under /usr/java.

Quote:
export JAVA_HOME="/usr/java/jre1.6.0/bin"
Why did you set JAVA_HOME twice? I'm sure this is awfully confusing to the system.
 
Old 06-04-2007, 08:31 AM   #4
Ordinary12
Member
 
Registered: Feb 2007
Posts: 140

Original Poster
Rep: Reputation: 15
The only reason I did it this way was because this was the only information I was able to find on the internet. I actually downloaded the RPM version and installed it but after I did it I followed the instructions again because that's what someone told me to do. Do I need to delete everything I did and start over or can I just download the RPM again and install it? I tried to re-install the RPM yesterday but Fedora told me there was nothing to do. I really don't want to re-install Fedora again because of this.
 
Old 06-04-2007, 10:15 AM   #5
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 131Reputation: 131
It shouldn't matter, you can simply keep your own version instead of getting rpm.bin - the main thing is you make sure that your JAVA_HOME is pointing to the exact location of your java folder. Where did you place it? That's where it should point to.

I also noticed you were using it like JAVA_HOME=/.../.../jdk/bin - which is wrong: the /bin part needs to be dropped. The only place you would actually add the "/bin" part is in the update-alternatives" commands.
 
Old 06-04-2007, 10:23 AM   #6
hollywoodb
Member
 
Registered: Aug 2003
Location: Minnesota, U.S.A.
Distribution: Debian, openSUSE
Posts: 400

Rep: Reputation: 30
I've always followed the instructions at http://fedorasolved.org and have never had an issue.
 
Old 06-12-2007, 07:28 PM   #7
Ordinary12
Member
 
Registered: Feb 2007
Posts: 140

Original Poster
Rep: Reputation: 15
Hey Jay73:

I followed your directions and made sure that the Java.sh file was pointing to the right directory. It still doesn't work. I followed the directions on www.fedorasolved.org. It still didn't work. I believe this problem is something simple but I can't seem to get enough information out there for someone to help me so I've decided to ask for help over the phone. If anyone is willing to talk me through this I will reimburse them for the call. It's a temp phone I bought so it won't work after two or three day. 662-523-5678.
 
  


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 not working - Iceweasel 2.0.0.3, Java RE 1.6.0.01 Brian Ryans Linux - Software 7 05-11-2007 02:40 PM
Java not working. Red Knuckles Debian 1 12-23-2006 07:58 PM
Java/Firefox java plugin not working with HP Webjetadmin iamskykid Linux - Software 2 03-02-2006 02:38 PM
java working, java plugin not provkitir *BSD 3 01-12-2005 05:49 PM
Web start java not working (java works fine) powadha Debian 5 06-05-2004 12:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 02:48 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