# Help compiling Ruby Java Bridge on OS X?

**URL:** <https://www.ruby-forum.com/t/help-compiling-ruby-java-bridge-on-os-x/67380>\
**Category:** Ruby\
**Created:** [September 3, 2006, 3:51am UTC](https://www.ruby-forum.com/t/help-compiling-ruby-java-bridge-on-os-x/67380 "2006-09-03T03:51:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 3, 2006, 3:51am UTC](https://www.ruby-forum.com/t/help-compiling-ruby-java-bridge-on-os-x/67380/1 "2006-09-03T03:51:36Z")

</div>

Hi all,

I’m stuck so I thought’d I ping out to see if anyone else has done  
this. Of course, asking for help is the best to be sure I find the  
answer myself in 10 minutes. 🙂

I’m on the latest version of OS X w/an Intel chip. I’m running Ruby  
1.8.4

I’m trying to install the Ruby Java Bridge and it needs to compile  
native extensions. mkmf says it’s failing because it can’t find jni.h

Here’s the trace:

jrr-mbp:~/Desktop/Ruby Java Bridge Projects/rjb-1.0.0 jared$ ruby  
setup.rb config  
—\> bin  
\<— bin  
—\> lib  
\<— lib  
—\> ext  
/usr/local/bin/ruby “/Users/jared/Desktop/Ruby Java Bridge  
Projects/rjb-1.0.0/ext/extconf.rb”  
\*\*\* /Users/jared/Desktop/Ruby Java Bridge  
Projects/rjb-1.0.0/ext/extconf.rb failed \*\*\*  
Could not create Makefile due to some reason, probably lack of  
necessary libraries and/or headers. Check the mkmf.log file for more  
details. You may need configuration options.

Provided configuration options:  
–with-opt-dir  
–without-opt-dir  
–with-opt-include  
–without-opt-include=${opt-dir}/include  
–with-opt-lib  
–without-opt-lib=${opt-dir}/lib  
–with-make-prog  
–without-make-prog  
–srcdir=/Users/jared/Desktop/Ruby Java Bridge  
Projects/rjb-1.0.0/ext  
–curdir  
–ruby=/usr/local/bin/ruby  
setup.rb:535:in `command': 'system /usr/local/bin/ruby "/Users/jared/Desktop/Ruby Java Bridge Projects/rjb-1.0.0/ext/extconf.rb" ' failed (RuntimeError) from setup.rb:1112:in `extconf’  
from setup.rb:1107:in `config_dir_ext' from setup.rb:1321:in `traverse’  
from setup.rb:1338:in `dive_into' from setup.rb:1319:in `traverse’  
from setup.rb:1313:in `exec_task_traverse' from setup.rb:1308:in `exec\_task\_traverse’  
from setup.rb:1097:in `exec_config' from setup.rb:878:in `exec\_config’  
from setup.rb:710:in `invoke' from setup.rb:674:in `invoke’  
from setup.rb:1352  
jrr-mbp:~/Desktop/Ruby Java Bridge Projects/rjb-1.0.0 jared$

Here’s the ext/mkmf.log file

jrr-mbp:~/Desktop/Ruby Java Bridge Projects/rjb-1.0.0 jared$ cat  
ext/mkmf.log  
have\_header: checking for jni.h… -------------------- no

“gcc -E -I. -I/usr/local/lib/ruby/1.8/i686-darwin8.5.2 -g -O2 -pipe  
-fno-common conftest.c -o conftest.i”  
conftest.c:1:17: error: jni.h: No such file or directory  
checked program was:  
/\* begin _/  
 #include \<jni.h\>  
/_ end \*/

* * *

Any help would be appreciated!

Jared  
[http://jaredrichardson.net](http://jaredrichardson.net)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 5, 2006, 12:26am UTC](https://www.ruby-forum.com/t/help-compiling-ruby-java-bridge-on-os-x/67380/2 "2006-09-05T00:26:32Z")

</div>

> I’m trying to install the Ruby Java Bridge and it needs to compile  
> native extensions. mkmf says it’s failing because it can’t find jni.h

Is your JAVA\_HOME environment variable set?

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 5, 2006, 7:08pm UTC](https://www.ruby-forum.com/t/help-compiling-ruby-java-bridge-on-os-x/67380/3 "2006-09-05T19:08:08Z")

</div>

rickhg12hs wrote:

> > I’m trying to install the Ruby Java Bridge and it needs to compile  
> > native extensions. mkmf says it’s failing because it can’t find jni.h
> 
> Is your JAVA\_HOME environment variable set?

JAVA\_HOME is not set. The main page ([http://rjb.rubyforge.org/](http://rjb.rubyforge.org/)) says  
not to set it for OS X. I did set it at one point to see it would make  
a difference, but it didn’t. I’m new to OS X, so I’m not sure I set it  
to what the program would be looking for anyway.

Is your experience different?

Jared  
[http://jaredrichardson.net](http://jaredrichardson.net)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 5, 2006, 7:54pm UTC](https://www.ruby-forum.com/t/help-compiling-ruby-java-bridge-on-os-x/67380/4 "2006-09-05T19:54:14Z")

</div>

Le 5 sept. 06 Ã 19:05, removed\_email\_address@domain.invalid a Ã©crit :

> JAVA\_HOME is not set. The main page ([http://rjb.rubyforge.org/](http://rjb.rubyforge.org/)) says  
> not to set it for OS X. I did set it at one point to see it would  
> make  
> a difference, but it didn’t. I’m new to OS X, so I’m not sure I set it  
> to what the program would be looking for anyway.

in order to verify if JAVA\_HOME is set or not type in term :

> echo $JAVA\_HOME

here i get :

/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home

if i remember well, my JAVA\_HOME is allways set and i didn’t have  
prob playing with yajb

Yvon
