LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   how to set path? permanently (https://www.linuxquestions.org/questions/ubuntu-63/how-to-set-path-permanently-534505/)

AVD_ZM 03-04-2007 12:20 PM

how to set path? permanently [SOLVED]
 
hey all,

i just installed jdk6 and i want 2 set the path permanently.
coz every time i wanna call java i have to type the entire path.

also would this help firefox to be able to call java runtime Environment (JRE)?

thanks

Micro420 03-04-2007 01:14 PM

You can set the path environment in your .bash_profile. This only affects you and not other users. If you want a system wide path, which all users have the path, then add it to /etc/profile

AVD_ZM 03-04-2007 02:04 PM

Quote:

Originally Posted by Micro420
You can set the path environment in your .bash_profile. This only affects you and not other users. If you want a system wide path, which all users have the path, then add it to /etc/profile

here's whats in my bash_profile

# include .bashrc if it exists
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# set PATH so it includes user's private bin if it exists
if [ -d ~/bin ] ; then
PATH=~/bin:"${PATH}"
fi
-----------

so do i just add
# set PATH so it includes user's private bin if it exists
if [ -d ~/bin ] ; then
PATH=~/bin:"${PATH}"
PATH =${PATH}:/Java's dir
fi

thanks

reddazz 03-04-2007 02:15 PM

You need to add something that similar to below
Code:

export PATH=$PATH:/path/to/java/bin
That should go at the bottom of the page.

AVD_ZM 03-06-2007 01:57 PM

Quote:

Originally Posted by reddazz
You need to add something that similar to below
Code:

export PATH=$PATH:/path/to/java/bin
That should go at the bottom of the page.

I tried export it did put it in the path,
but it was temporary, when i restarted it was gone.

i also tried editing in bash_profile

# set PATH so it includes user's private bin if it exists
if [ -d ~/bin ] ; then
PATH=~/bin:"${PATH}"
PATH =${PATH}:/Java's dir
fi

it didn't help. I kubuntu fresh and when i type
"$PATH" it brings me

/home/avd/mono-1.2.3.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games: No such file or directory

why do i have no such file or directory?

AVD_ZM 03-06-2007 04:41 PM

YEEPEE!!!

I got it!!!

# include .bashrc if it exists
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# set PATH so it includes user's private bin if it exists
if [ -d ~/bin ] ; then
PATH=~/bin:"${PATH}"
fi
PATH="${PATH}":~/jdk1.6.0/bin


All times are GMT -5. The time now is 07:04 AM.