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 need to install a program for my studies and, this program, need java to run. When I try to perform the installation say that cannot find the JDK; since the JDK is already installed by default in mac, the problem is export the java home.

I´ve try a lot and I cant do it! I know that I have to add a line in a .bashrc file (or .profile, or .bash_profile) I´ve created all those files, at different times but nothing...

I´m a new mac user, but I use Linux too and I dont know what happened, I just need to export java home to perform my work... and is really necessary for me to add environment variables too.

Thanks for your help

share|improve this question

Add this to your ~/.profile file:


And log out and log back in to your account.

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.