I had spent a lot of time setting the $PATH on my Ubuntu but i forgot to document the procedure. So when my friend asked me, i wasn’t able to help him out. So this time i asked him to tell the solution so that i could note it down. The best place would be my blog.
JAVA_HOME=/usr/lib/jvm/java export JAVA_HOME PATH=$PATH:$JAVA_HOME/bin export PATH
Source: The Ubuntu Guy.
Categories: Ubuntu
What file do you insert this text into?
LikeLike
these commands are used at the command prompt if i am not wrong.
LikeLike
I hope export will work only with bash prompt. Better to mention it to avoid confusion
LikeLike
Thanks, this actually works. The problem is when I reboot to Ubuntu the variables are no longer set. How do I set it permanently?
Thanks
Harlan. (new to Ubuntu)
LikeLike
U can set u’r environment vairables in the file .bash_aliases which is there in user’s home directory. The file would contain-
PATH=/home/user/jdk1.6.0_16/bin:/usr/bin:/bin:/usr/local/bin:/usr/sbin/
export PATH
U can also add other environment variables like CLASSPATH. Note that the other bin dir paths are for u’r shell commands. After editing this file restart your terminal. Hope this helps.
LikeLike