Mavericks Issue? #86

xjamundx opened this Issue Nov 11, 2013 · 5 comments


None yet

4 participants


I'm not a Java expert, but I am having this issue.

~/dev $ npm install java@0.2.7
npm http GET
npm http 200
npm http GET
npm http 200

> java@0.2.7 install /Users/jamuferguson/dev/node_modules/java
> node-gyp rebuild

  CXX(target) Release/
In file included from ../src/java.cpp:2:
../src/java.h:7:10: fatal error: 'jni.h' file not found
#include <jni.h>
1 error generated.
make: *** [Release/] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Darwin 13.0.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/jamuferguson/dev/node_modules/java
gyp ERR! node -v v0.10.21
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok 
npm ERR! weird error 1
npm ERR! not ok code 0

Here is my version number and stuff

~/dev $ which java
~/dev $ java -version
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

Seems like perhaps JAVA_HOME may not being discovered properly. I'd try manually setting that, and if that still doesn't work, mucking with binging.gyp line ~130 until you can resolve the issue.


I was having the same issue as Jamund and I've managed to work around it. The solution seems to be setting the JAVA_HOME env variable. I also updated to 1.7.0_45 but I'm not sure that had any effect on finding the solution.


I'm on Mavericks with the same version of Java and haven't seen this issue and can't reproduce it by unsetting or changing JAVA_HOME.


In case anyone else has the problem. I did the following.

  1. Installed newest Java from
  2. export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/
  3. npm install java

See: for a reference

@xjamundx xjamundx closed this Nov 13, 2013

In talking with a few other folks who have Mavericks and did not have this issue, it appears that if you had 1.7.0_45 before upgrading to Mavericks the issue doesn't appear. After Mavericks the JDK installer no longer appears to update the current_jdk link. So, the only way to solve the issue is to set JAVA_HOME or update the link to point to the latest JDK.

@ArkeologeN ArkeologeN referenced this issue in inolen/gremlin-node Dec 7, 2013

Error: installing gremlin with orientdb #60

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment