Monday, November 26, 2012

How to set PATH in Linux/Solaris ?

PATH can be ORACLE_HOME, JAVA_HOME, CATALINA_HOME ,etc but steps to set will be same.

There are three types file you will encounter when working on Linux,Solaris & Mac-OS.

  1. .bash_profile --linux
  2. .profile         --Solaris
  3. .bashrc
For setting the path variable in Linux/Solaris follow the steps as below
  1. Go to the home directory or go by typing cd , then press enter .
  2. Here I am using ORACLE_HOME just for the demonstration , you can set any path like this.
  3. Open the profile, for example : vi .bash_profile
  4. Write
    • ORACLE_HOME=/usr/lib/oracle/11.2/client64
    • export ORACLE_HOME
  5. Save it .
  6. Execute it
    • . ~/.bash_profile
Check the Oracle Home by echo $ORACLE_HOME

For more demonstration on how to install Java on Linux . Please see my post on how to install java on Linux.


if you find this information useful, please comment.

2 comments: