Pivotal Labs

Alex Chaffee's blog



JAVA_HOME on Mac OS X

edit Posted by Alex Chaffee on Thursday June 26, 2008 at 06:57PM

For the millionth time, cause I always forget...

Put this in ~/.bashrc:

export JAVA_HOME=/Library/Java/Home

Also, run "sudo visudo" and add the line

Defaults        env_keep += "JAVA_HOME"

or else commands like "sudo gem install" won't be able to find Java.

Without the above, I got the following error (which seemed to have been run through a baby-talk filter) when running "sudo gem install rjb":

extconf.rb:44: JAVA_HOME is not setted. (RuntimeError)