Export PATH or JAVA_HOME when no permission to edit ~/.bash_profile or ~/.bashrc file

When a user did not have permission to add a new PATH entry in bash_profile, just use the below command in any terminal:
$ export PATH=$PATH:/new/path     (where /new/path is the path to be added)
$ export PATH=$PATH: /usr/local/jdk1.6.0_06/bin   (for java path)

for JAVA_HOME:
$ export JAVA_HOME=/usr/local/jdk1.6.0_06/

This new path variable will be visible for that terminal for the whole session. Once the terminal is closed, new PATH will also be vanished.

Comments

Popular posts from this blog

attach file gives false disk address path as 'C:/fakepath/filename'

How to fix World-writable config file /etc/my.cnf is ignored?

Ajmer tour on 18th June '11