Error: Cannot find module 'java'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:286:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object. (/Users/guzhang/projects/node-java/test/test.js:1:74)
at Module._compile (module.js:434:26)
at Object.Module._extensions..js (module.js:452:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:475:10)
The tets.js contains this:
var java = require('java');
var javaLangSystem = java.import('java.lang.System');
I'm running mac os x el capitan 10.11.4
$ sudo npm install -g
CXX(target) Release/obj.target/nodejavabridge_bindings/src/java.o CXX(target) Release/obj.target/nodejavabridge_bindings/src/javaObject.o CXX(target) Release/obj.target/nodejavabridge_bindings/src/javaScope.o CXX(target) Release/obj.target/nodejavabridge_bindings/src/methodCallBaton.o CXX(target) Release/obj.target/nodejavabridge_bindings/src/nodeJavaBridge.o CXX(target) Release/obj.target/nodejavabridge_bindings/src/utils.o SOLINK_MODULE(target) Release/nodejavabridge_bindings.node
/usr/local/lib └── java@0.7.0
$ node test/test.js module.js:338 throw err; ^
Error: Cannot find module 'java' at Function.Module._resolveFilename (module.js:336:15) at Function.Module._load (module.js:286:25) at Module.require (module.js:365:17) at require (module.js:384:17) at Object. (/Users/guzhang/projects/node-java/test/test.js:1:74)
at Module._compile (module.js:434:26)
at Object.Module._extensions..js (module.js:452:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:475:10)
The tets.js contains this:
var java = require('java'); var javaLangSystem = java.import('java.lang.System');
javaLangSystem.out.printlnSync('Hello World');