File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Linux / UNIX and the fly likes permanent env varibales set up in bash shell Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "permanent env varibales set up in bash shell" Watch "permanent env varibales set up in bash shell" New topic
Author

permanent env varibales set up in bash shell

arun ramk
Greenhorn

Joined: Aug 09, 2008
Posts: 26
Hi friends,


Please let me know how to set up environmental variables in bash shell in linux.....
i need to setup environmental variables for java and oracle installations

i used export command....... but the variables exist only for that session........

please help
Balu Sadhasivam
Ranch Hand

Joined: Jan 01, 2009
Posts: 874



Arun,

1) Reach the home directory. and search for /.bash_profile file.
2) Open in vi (or other prefered) editor
3) Add the env variables , save it
4) run ./.bash_profile or logout and login
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16545
    
  25

Note: "/.bash_profile" refers to a file at the root of the filesystem. What you actually want to edit is one of the following:

~/.bash+profile

$(HOME)/.bash_profile

/home/xxxx/.bash_profile (where xxxx is your home directory name)

These are all references to the same file, but the first 2 are abbreviations provided by bash.


Customer surveys are for companies who didn't pay proper attention to begin with.
Balu Sadhasivam
Ranch Hand

Joined: Jan 01, 2009
Posts: 874


yeah ~/.bash_profile , here ~ is home directory.

[typo error in my previous post.]
 
Don't get me started about those stupid light bulbs.
 
subject: permanent env varibales set up in bash shell