Linux Forums - Linux Help,Advice & support community:LinuxSolved.com

Linux Software => Linux Installation Support => Topic started by: hawk on August 03, 2004, 09:14:43 AM

Title: How to change bash profile?
Post by: hawk 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.
Title: How to change bash profile?
Post by: dragoncity99 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]