LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 01-13-2009, 11:33 AM   #1
vitalstrike82
Member
 
Registered: Oct 2007
Location: Singapore
Distribution: OpenSuse, Slackware, Redhat
Posts: 315

Rep: Reputation: 40
set up java_home path in /home/user/.bashrc but use path in /usr/lib/java


Greetings,

i'm setting up java path in /home/user/.bashrc file.
This are what i have written in the .bashrc file:

export PATH=/home/user/jdk1.5.0_17/bin:$PATH
export JAVA_HOME="/home/user/jdk1.5.0_17"
export J2EE_HOME="/home/user/SDK"
export CLASSPATH=.:/home/user/jdk1.5.0_17

How do i overwrite he /usr/lib/java so it can use the jdk i download and place in my home path?


Thanks
 
Old 01-13-2009, 04:03 PM   #2
gsl
LQ Newbie
 
Registered: Jun 2007
Location: Melbourne, Australia
Distribution: Slackware
Posts: 24

Rep: Reputation: 4
Quote:
Originally Posted by vitalstrike82 View Post
i'm setting up java path in /home/user/.bashrc file.
If you want these settings to work in a login shell, I think you need to put them in .bash_profile, not .bashrc.

Geoff.
 
Old 01-13-2009, 09:12 PM   #3
vitalstrike82
Member
 
Registered: Oct 2007
Location: Singapore
Distribution: OpenSuse, Slackware, Redhat
Posts: 315

Original Poster
Rep: Reputation: 40
Quote:
Originally Posted by gsl View Post
If you want these settings to work in a login shell, I think you need to put them in .bash_profile, not .bashrc.

Geoff.
Hi,

where do i find the .bash_profile? is it in the root? or i need to create it like the .bashrc?

And second, where does it specify at the first place that make the system to look for the java path in /usr/lib/java instead of my path stated in the .bashrc?

Thanks



Thanks
 
Old 01-13-2009, 09:22 PM   #4
astrogeek
Senior Member
 
Registered: Oct 2008
Distribution: Slackware: 12.1, 13.1, 14.1, 64-14.1, -current, FreeBSD-10
Posts: 1,658

Rep: Reputation: 570Reputation: 570Reputation: 570Reputation: 570Reputation: 570Reputation: 570
Quote:
Originally Posted by vitalstrike82 View Post
where does it specify at the first place that make the system to look for the java path in /usr/lib/java instead of my path stated in the .bashrc?
That gets set in /etc/profile.d/jdk.sh at login.

If you have the jre installed instead it will be /etc/profile.d/jre.sh - or something similar, not sure what java package you have installed.

Last edited by astrogeek; 01-13-2009 at 09:45 PM.
 
Old 01-13-2009, 11:25 PM   #5
gsl
LQ Newbie
 
Registered: Jun 2007
Location: Melbourne, Australia
Distribution: Slackware
Posts: 24

Rep: Reputation: 4
Quote:
Originally Posted by vitalstrike82 View Post
where do i find the .bash_profile? is it in the root? or i need to create it like the .bashrc?
Create it in your home directory. Check out the "INVOCATION" section of the bash manpage for a complete explanation of which files are read and executed. Bash will read /etc/profile first which in turn reads every executable *.sh in /etc/profile.d/. After this it reads your ~/.bash_profile which overrides the settings from /etc/profile.d/jdk.sh.

Geoff.
 
  


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 set up path,classpath,catalina home for java in fedora -9 vicky7038 Linux - Software 1 08-19-2008 08:41 AM
export Path=/usr/java:$Path does not seem to work lumix Linux - Newbie 1 03-19-2007 03:11 PM
Relocat /usr/lib and /usr/lib64 to a different path schokshi Fedora 3 08-30-2005 09:14 PM
Set the path systemwide/Set the path for a user with Slackware jayhel Slackware 1 06-12-2005 12:24 AM
JAVA_HOME path not set for all users tantric Linux - Software 5 03-29-2004 01:25 PM


All times are GMT -5. The time now is 09:03 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration