LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 10-20-2006, 06:17 PM   #1
allelopath
Member
 
Registered: Jan 2003
Location: New Mexico
Distribution: Ubuntu 18.04.3 LTS
Posts: 539

Rep: Reputation: 30
Define java for user


In my bash shell I have this:
export JAVA_HOME=/usr/lib/jdk1.5.0_09

but when I do this command:
#java -version
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_08-b03)
Java HotSpot(TM) Client VM (build 1.4.2_08-b03, mixed mode)

Where is the definition of this for my user?
(Suse 9.2)
 
Old 10-20-2006, 07:23 PM   #2
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,780

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
echo $JAVA_HOME
maybe? not exactly sure what you're looking for...
 
Old 10-20-2006, 07:30 PM   #3
zhangmaike
Member
 
Registered: Oct 2004
Distribution: Slackware
Posts: 376

Rep: Reputation: 31
Typing:

Code:
which java
will show you the location of java in your path. If you're expecting different version output, perhaps you have two versions of java installed?

If that's the case, decide which java you want to use by default, modify $PATH accordingly, and specify the complete path whenever you want to use the other java.
 
Old 10-21-2006, 03:05 AM   #4
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
Try the following
Code:
export JAVA_HOME=/usr/lib/jdk1.5.0_09
export MANPATH=$JAVA_HOME/man:$MANPATH
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH

Last edited by reddazz; 10-21-2006 at 03:06 AM.
 
Old 10-21-2006, 01:46 PM   #5
allelopath
Member
 
Registered: Jan 2003
Location: New Mexico
Distribution: Ubuntu 18.04.3 LTS
Posts: 539

Original Poster
Rep: Reputation: 30
Thanks for the responses.
I tried reddazz's solution and now all is well:

> echo $JAVA_HOME
/usr/lib/jdk1.5.0_09
> which java
/usr/lib/jdk1.5.0_09/bin/java
 
  


Reply



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 works- but only for user and in X Janusz11 Linux - Software 1 10-14-2006 07:25 AM
New User with Java and Firefox dreyes81 Linux - Newbie 5 07-14-2005 05:04 PM
how to define user-defined commands in linux mannoulla Linux - General 1 04-05-2005 09:01 PM
How can I define permissions on a /home/user dir _before_ creating it with adduser skunkburner Linux - General 6 03-18-2004 03:42 PM
define start-bash for user... pablovschby Linux - Software 16 11-13-2003 02:52 PM

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

All times are GMT -5. The time now is 12: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
Open Source Consulting | Domain Registration