1

One of the applications requires JAVA_HOME variable. Java is installed. In ~/.profile I have this:

PATH="/usr/local/heroku/bin:/usr/share/perl6/vendor/bin:/home/arch/.local/bin:$PATH"

JAVA_HOME="/usr/lib/jvm/default"
export JAVA_HOME

PATH=${JAVA_HOME}/bin:${PATH}

I've added the last 3 lines. Then I ran source ~/.profile and the same terminal window it showed the /usr/lib/jvm/default which was correct. However, in the new terminal it showed nothing. What did I forget?

1
  • did you open the new terminal after you edited your .profile? – Wayne_Yux May 28 '16 at 10:30
4

.profile is run at login but a new terminal window is not a login and instead runs ~/.bashrc.

if you log out of your session and login again your .profile will have the desired effect and your new terminal sessions after the login will inherit these settings from the initial login.

1
  • should java_home include the bin directory? – Oskar K. May 28 '16 at 11:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.