Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 comment

1 Answer

Add this to your ~/.profile file:

JAVA_HOME=`/usr/libexec/java_home`

And log out and log back in to your account.

share|improve this answer
add comment

Your Answer

 
discard

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.