mxcl/homebrew — Issue #8325: gettext-0.18.1.1 fails on Lion running javac
Author: nikomatsakis
Created: 2011-10-27 16:34:48+00:00
State: open

I was experiencing problems installing gettext on my Lion installation due to errors running javac. The problem seems to be that the gettext build scripts unset JAVA_HOME if JAVAC is not set when the configure script runs. I have no idea why they do this, no doubt for some good reason, but it breaks the Apple-supplied javac, which relies on JAVA_HOME to find its runtime.

My fix was to run "brew edit gettext" and add the following line:
```
ENV['JAVAC'] = "/usr/bin/javac"
```
immediately prior to the step that runs configure. This line is something of a hack so perhaps there is a better fix, but it worked for me.

I didn't find any other issues discussing this issue, so I apologize if it is a duplicate. I am not sure if the problem is Lion-specific or not.