LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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-07-2011, 01:03 PM   #1
Whatif
Member
 
Registered: Nov 2010
Distribution: VectorLinux
Posts: 87

Rep: Reputation: 0
java path


I have installed CentOS 5.5 and included the java development package. When I typed java -version, I got java 1.6.0. The problem is with the javac command, which is not found. I tried the following:

export PATH=$PATH:/usr/java/jdk1.6.0/bin

didn't work!

Any suggestions?

Thanks,
Mike
 
Old 02-07-2011, 01:14 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,393

Rep: Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607
Setting up a new java in CentOS ..

1) su
2)
/usr/sbin/alternatives --install /usr/bin/java java /usr/java/jdk1.6.0_23/bin/java 2

3) /usr/sbin/alternatives --config java
 
Old 02-07-2011, 01:31 PM   #3
Whatif
Member
 
Registered: Nov 2010
Distribution: VectorLinux
Posts: 87

Original Poster
Rep: Reputation: 0
I tried these commands and was given three options:

1 /usr/lib/jvm/jre-1.6.0-openjdk/bin/java
2 /usr/lib/jvm/jre-1.4.2-gcj/bin/java
3 /usr/lib/jvm/jdk1.6.0_23/bin/java

I chose option 3 but issuing the java -version resulted in bash : java : command not found.
I then tried option 1 and 2, issuing the java -version displayed java version and additional info but the javac is still not found, bash : javac : command not found

What else could I try?

Last edited by Whatif; 02-07-2011 at 06:55 PM.
 
Old 02-08-2011, 03:34 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,393

Rep: Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607
Quote:
3 /usr/lib/jvm/jdk1.6.0_23/bin/java
Are you sure, you have /usr/lib/jvm/jdk1.6.0_23/bin/ ?
Will only be present, when you install the sun-java-jdk
http://www.if-not-true-then-false.co...-red-hat-rhel/

A standard install will provide /usr/java/jdk1.6.0_23/bin/java
( /usr/java/ instead of /usr/lib/jvm/jdk1.6.0_23 ).

..
 
Old 02-08-2011, 04:12 PM   #5
Whatif
Member
 
Registered: Nov 2010
Distribution: VectorLinux
Posts: 87

Original Poster
Rep: Reputation: 0
I'm sorry.....I typed that in error. It's /usr/java/jdk1.6.0_23/bin/java

I will try the instructions in the link you provided, thanks.

Last edited by Whatif; 02-08-2011 at 06:15 PM.
 
Old 02-09-2011, 04:34 PM   #6
Whatif
Member
 
Registered: Nov 2010
Distribution: VectorLinux
Posts: 87

Original Poster
Rep: Reputation: 0
Still not working! I tried the following:

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

/usr/sbin/alternatives --install /usr/bin/javac javac /usr/java/jdk1.6.0_23/bin/javac 2

running javac -version gives command not found.

Anything else I could try?
 
Old 02-10-2011, 06:15 PM   #7
Whatif
Member
 
Registered: Nov 2010
Distribution: VectorLinux
Posts: 87

Original Poster
Rep: Reputation: 0
I tried these commands, here is the output:

rpm -q centos-release
centos-release-5-5.el5.centos

locate bin/javac
locate : can not open '/var/lib/mlocate/mlocate.db' : no such file or directory

rpm -qf /usr/java/jdk1.6.0_23/bin/javac
error : file /usr/java/jdk1.6.0_23/bin/javac : No such file or directory


any suggestions?
 
Old 02-11-2011, 01:53 PM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,393

Rep: Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607
How did you install jdk1.6.0_23 ? Package name, please.

For my systems, I use : jdk-1.6.0_22-fcs.i586.rpm / jdk-1.6.0_22-fcs.x86_64.rpm
http://ftp.scientificlinux.org/linux...2-fcs.i586.rpm
http://ftp.scientificlinux.org/linux...fcs.x86_64.rpm
In the CentOS identical 'Scientific Linux SL55' it's simply # yum install jdk


About 'locate' : Please run # 'updatedb' to create / update /var/lib/mlocate/mlocate.db

..

Last edited by knudfl; 02-11-2011 at 02:00 PM.
 
  


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 applet not loading image with relative path but loads image with absolute path amolgupta Programming 2 07-20-2009 02:58 PM
set up java_home path in /home/user/.bashrc but use path in /usr/lib/java vitalstrike82 Slackware 4 01-14-2009 12:25 AM
Ubuntu 7.10 64bit - how to set java path to/redirect java to libjvm.so ? Thane Ubuntu 1 03-25-2008 06:52 PM
export Path=/usr/java:$Path does not seem to work lumix Linux - Newbie 1 03-19-2007 04:11 PM
Java can't find package, but PATH set correctly (j2se1.4.0, java.util.regex package) Ethan Programming 5 02-06-2004 10:55 PM

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

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