Adding Path to Environment in Ubuntu

After adding some software or programing language or whatever to ubuntu, mostly using the non-synaptic method, our command line would crave for the new terms ;).
Here is how to add the new path to the environment
Lets use how to add the tomcat app server after we install it using the tar file.

1. Open the terminal : Application->Accessories->Terminal
2. use your favorite text editor to open /etc/environment in my case I would use view as vi /etc/environment
3. add the path on new line as CATALINA_HOME=”path/to/catalina”
4. save and exit!!
In most cases, the current shell would not see the effect and you may want to open another tab for that or you can use the export command

if we are appending to the existing path variable, we can use the export command as
export PATH = ${PATH}:/path/to/new/location – here the ${PATH} would maintain the existing path information and the colon would be the separator for the paths