Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I inserted the following in '/etc/profile'

JAVA_HOME=/usr/java/jdk1.6.0_21 export PATH=$PATH:$JAVA_HOME/bin

But when I 'sudo su' from my regular account, it does not pick up the above java path: any suggestions?


share|improve this question

migrated from Sep 26 '10 at 12:34

This question came from our site for professional and enthusiast programmers.

Try doing

sudo su -
share|improve this answer

When you do sudo su then su is not a login shell, and file /etc/profile is not processed. In order to make su a login shell you can call it with --login, -l or - option. So, use sudo su -.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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