[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

PATH=$PATH:/home/user/android-sdk/platform-tools:/home/user/java/jdk1.8.0_121/bin
export JAVA_HOME=/home/user/java/jdk1.8.0_121
export STUDIO_JDK=$JAVA_HOME
export JDK_HOME=$JAVA_HOME

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

Advertisements

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 )

Google+ photo

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

Connecting to %s