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.
$ 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