LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   set up java_home path in /home/user/.bashrc but use path in /usr/lib/java (http://www.linuxquestions.org/questions/slackware-14/set-up-java_home-path-in-home-user-bashrc-but-use-path-in-usr-lib-java-697028/)

vitalstrike82 01-13-2009 11:33 AM

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

gsl 01-13-2009 04:03 PM

Quote:

Originally Posted by vitalstrike82 (Post 3407247)
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.

vitalstrike82 01-13-2009 09:12 PM

Quote:

Originally Posted by gsl (Post 3407523)
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

astrogeek 01-13-2009 09:22 PM

Quote:

Originally Posted by vitalstrike82 (Post 3407772)
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.

gsl 01-13-2009 11:25 PM

Quote:

Originally Posted by vitalstrike82 (Post 3407772)
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.


All times are GMT -5. The time now is 02:33 AM.