[Ubuntu] Adding a folder to your path permantently

After various incorrect SO answers, I’ve found the right solution for ubuntu 16.04 LTS.

cd ~
cat .profile

edit .profile file and add these lines

export JAVA_HOME=/home/user/java/jdk1.8.0_121

Then Ctrl+X and save

After rebooting my machine (closing the terminal didn’t work, I don’t know if closing session will be enough, but anyway my machine boots in 15 seconds so rebooting is quite fast :P) I can work with the new path. To check it:

java -version

should return the correct version of Java installed


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s