1

I am getting an error in the following node-plugin and opened an issue: plugin is here: https://github.com/joeferner/node-java issue is here: https://github.com/joeferner/node-java/issues/306

I see a similar problem that was solved on SO regarding developers who use rStudio: libjvm.so: cannot open shared object file: No such file or directory

I am having a similar error when I launch my node app to heroku:

return process.dlopen(module, path._makeLong(filename));
                 ^

Error: libjvm.so: cannot open shared object file: No such file or directory
    at Error (native)
    at Object.Module._extensions..node (module.js:440:18)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (/app/node_modules/java/lib/nodeJavaBridge.js:31:16)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
Community
  • 1
  • 1
J0NNY ZER0
  • 707
  • 2
  • 13
  • 32

1 Answers1

1

It looks like you'll need to set the JAVA_HOME environment variable like this:

$ heroku config:set JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64"

This is because you are using the stack JDK (the default JDK). You can also use a custom JDK (usually a newer version) by adding the jvm-common buildpack to your app, which will also set JAVA_HOME for you:

$ heroku buildpacks:clear
$ heroku buildpacks:add https://github.com/heroku/heroku-buildpack-jvm-common
$ heroku buildpacks:add heroku/nodejs

Then redeploy with git push.

codefinger
  • 10,088
  • 7
  • 39
  • 51