LinuxQuestions.org
Latest LQ Deal: Linux Power User 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 07-26-2008, 03:43 AM   #1
souvikc
LQ Newbie
 
Registered: Jul 2008
Location: India
Distribution: fedora 6
Posts: 14

Rep: Reputation: 0
Unhappy problem installing jdk 1.6 in fedora 6


Hello everyone...i am very new to linux..initially i used the red hat 9 distro but due to compattibility problems i am using fedora core6 (as instructed my many in this forum).but the problem is am not able to install jdk 1.6 here which i did quite easily in RH9.i did the folowing things----

1.rm /var/lib/alternatives/java

then pressed the y key

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



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

4./usr/sbin/alternatives --config java

5.then these things came---
There are 2 programs which provide 'java'.

Selection Command
-----------------------------------------------
1 /usr/lib/jvm/jre-1.4.2-gcj/bin/java
*+ 2 /usr/java/jdk1.6.0/jre/bin/java

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


i pressed the enter key..

6./usr/sbin/alternatives --display java

this showed
java - status is manual.
link currently points to /usr/java/jdk1.6.0/jre/bin/java
/usr/lib/jvm/jre-1.4.2-gcj/bin/java - priority 1
/usr/java/jdk1.6.0/jre/bin/java - priority 2
Current `best' version is /usr/java/jdk1.6.0/jre/bin/java.

7.then i created the /etc/profile.d/java.sh
and wrote the following---
export JAVA_HOME="/usr/java/jdk1.6.0/jre/bin"
export JAVA_PATH="$JAVA_HOME"
export PATH="$PATH:$JAVA_HOME"

8.then source /etc/profile.d/java.sh

then i issued the which java command---this showed--
/usr/bin/which: no java in (/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/java/jdk1.6.0/bin/:/home/souvik/bin:/usr/java/jdk1.6.0/bin:/usr/java/jdk1.6.0/bin)


but the javac command is working..even the java -version says
command not found.



Hate to ask this of you but could you maybe run through a tutorial.since i am very new to linux..
THANXX..WAITING FOR REPLY
 
Old 07-26-2008, 05:52 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2017 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,735

Rep: Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317
Quote:
export JAVA_HOME="/usr/java/jdk1.6.0/jre/bin"
This is a script for "jre" You probably need one for "jdk"
too.
(I have 4 :java_10sdk.csh, java_10sdk.sh, java_20jre.csh,
java_20jre.sh)

Reason : jdk1.6.0/jre/bin : 'javac' is not in jdk1.6.0/jre/bin
but in jdk1.6.0/bin usually.

Regards

Last edited by knudfl; 07-26-2008 at 05:54 AM.
 
Old 07-26-2008, 09:58 AM   #3
souvikc
LQ Newbie
 
Registered: Jul 2008
Location: India
Distribution: fedora 6
Posts: 14

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by knudfl View Post
This is a script for "jre" You probably need one for "jdk"
too.
(I have 4 :java_10sdk.csh, java_10sdk.sh, java_20jre.csh,
java_20jre.sh)

Reason : jdk1.6.0/jre/bin : 'javac' is not in jdk1.6.0/jre/bin
but in jdk1.6.0/bin usually.

Regards
well javac command is working fine but it falters when i issued the which

java or java -version commands.i even edited the java home like this->


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

even then no good results.

Man i feel really embarrased to say you this but i really need a detailed
explanation.what should i do next..

THANX>>WAITING FOR REPLY.....
 
Old 07-26-2008, 10:13 AM   #4
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
I don't know how much of a difference it makes, but you don't need the quotes in your environment variables. Also, FWIW, Fedora Core 6 is out of date and no longer receives updates. You'd be better off upgrading to a newer version.
 
Old 07-26-2008, 11:26 AM   #5
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
I don't see why you had to remove the folder under var. Also I use these variables:

JAVA_HOME=/path/to/java/folder (i.e. just the java folder, not the bin inside it)
J2RE_HOME=$JAVA_HOME/jre
PATH=$PATH:$JAVA_HOME/bin

For what it's worth, setting up a jdk is a lot more straightforward if you use something like Ubuntu, Suse or Debian. One reason it's more straightforward is that, using update --alternatives, you need to update everything inside your java bin (including javac, javadoc, jar, etc.). Updating "java" alone may explain why which doesn't return anything for javac.
 
Old 07-26-2008, 03:43 PM   #6
souvikc
LQ Newbie
 
Registered: Jul 2008
Location: India
Distribution: fedora 6
Posts: 14

Original Poster
Rep: Reputation: 0
Question

Quote:
Originally Posted by jay73 View Post
I don't see why you had to remove the folder under var. Also I use these variables:

JAVA_HOME=/path/to/java/folder (i.e. just the java folder, not the bin inside it)
J2RE_HOME=$JAVA_HOME/jre
PATH=$PATH:$JAVA_HOME/bin

For what it's worth, setting up a jdk is a lot more straightforward if you use something like Ubuntu, Suse or Debian. One reason it's more straightforward is that, using update --alternatives, you need to update everything inside your java bin (including javac, javadoc, jar, etc.). Updating "java" alone may explain why which doesn't return anything for javac.
I am so near yet so far..i edited the java.sh in the /etc/profile.d ->

JAVA_HOME=/usr/java/jdk1.6.0_07

export JAVA_HOME
PATH=$PATH:$JAVA_HOME/bin/
J2RE_HOME=$JAVA_HOME/jre
export J2RE_HOME
export PATH
........

now everything seems to be okey the java -version command,the which java command.but as soon as i got out from su the same old problem...even i can do everything as superuser but not as a normal user...


THANX for taking out time for me...
 
Old 07-26-2008, 04:46 PM   #7
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
Then put the same variables in the .home_profile in your home directory.
 
Old 07-27-2008, 06:06 AM   #8
souvikc
LQ Newbie
 
Registered: Jul 2008
Location: India
Distribution: fedora 6
Posts: 14

Original Poster
Rep: Reputation: 0
Talking

yipeeee!!!

now every thing is working fine for me..
i restarted my machine n everything was okey then...
now i can learn JAVA IN LINUXX..



THANX A TON EVERYONE FOR SHARING YOUR VALUABLE TIME WITH ME....
 
  


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
How to install JDK on fedora 8? rIcKy RoCk$ Linux - Newbie 2 02-28-2008 07:37 AM
problem installing SUN JDK 1.5.10 eerpini Linux - Software 5 07-25-2007 08:20 AM
Help installing Java sdk/jdk 6 on Fedora core 6 tecksk8er001 Linux - Software 13 05-21-2007 07:38 PM
Installing IDEA and jdk shahnazyousuf Linux - Software 1 12-29-2004 02:14 AM
installing JDK on Slackware pogopogo Linux - Newbie 3 10-19-2004 03:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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