November 24, 2024, 04:05:45 PM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: How to change bash profile?  (Read 8699 times)

Offline hawk

  • Linux Noob !
  • *
  • Posts: 15
How to change bash profile?
« on: August 03, 2004, 09:14:43 AM »
hi..i want to run java programs under linux, but as a very newbie of linux i dont know how to change bash profile to compile and run java programs without giving the whole path everytime i hv to compile or run a proggy.

Offline dragoncity99

  • LST CareTaker
  • Experienced
  • *****
  • Posts: 551
How to change bash profile?
« Reply #1 on: August 05, 2004, 09:12:29 AM »
Let's say u install ur java sdk "j2sdk1.4.2_04" under /usr/local.
The full path to ur java will be: /usr/local/j2sdk1.4.2_04

Now to change it, just type:
"vi  $HOME/.bash_profile"

Now u see something like this in ur .bash_profile:


# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs
Quote
PATH=$PATH:$HOME/bin:/usr/local/j2sdk1.4.2_04/bin/
BASH_ENV=$HOME/.bashrc
USERNAME="root"
CVS_ROOT=/home/cvs
export USERNAME BASH_ENV PATH CVS_ROOT

I added the java path at the end of the line "PATH" as u can see above. Then logout and login again to ur account. Congratulations ;)
[/quote]