node-java icon indicating copy to clipboard operation
node-java copied to clipboard

Error: libjvm.so: cannot open shared object file: No such file or directory

Open jonnydungeons opened this issue 10 years ago • 10 comments

This happens on Heroku when load up the node-jdbc plugin which depends on this plugin. Full error is this:

Error: libjvm.so: cannot open shared object file: No such file or directory remote: at Error (native) remote: at Object.Module._extensions..node (module.js:440:18) remote: at Module.load (module.js:357:32) remote: at Function.Module._load (module.js:314:12) remote: at Module.require (module.js:367:17) remote: at require (internal/module.js:16:19) remote: at Object. (/app/node_modules/java/lib/nodeJavaBridge.js:21:16) remote: at Module._compile (module.js:413:34) remote: at Object.Module._extensions..js (module.js:422:10) remote: at Module.load (module.js:357:32)

jonnydungeons avatar Mar 23 '16 23:03 jonnydungeons

I posted this issue with a link to this page on stackoverflow as well http://stackoverflow.com/questions/36191073/node-java-error-libjvm-so-cannot-open-shared-object-file-no-such-file-or-dire

jonnydungeons avatar Mar 24 '16 00:03 jonnydungeons

I figured it out and it's nothing to do with anything in joe's code. My badd

jonnydungeons avatar Mar 24 '16 20:03 jonnydungeons

@J0NNYZER0 i have the same error. can i know what did you do?

melvinmmw avatar Jan 12 '17 13:01 melvinmmw

@J0NNYZER0 How can you solve this problem?

jude-liu avatar May 22 '17 10:05 jude-liu

If someone is coming here now, Please try the approach below:

Steps:

  1. Find your R location. It will be stored in rsession-ld-library-path in rserver.conf file. Or just by doing which R. The location usually is /usr/lib64/R/lib or /usr/lib64/microsoft-r/3.3/lib64/R/lib
  2. Find the libjvm.so file which is usually in the usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server path depending on which jre you're using. Check in $JAVA_HOME environment.
  3. Create a symlink using ln -s sudo ln -s /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so /usr/lib64/microsoft-r/3.3/lib64/R/lib/libjvm.so
  4. Restart R server

tejaslodaya avatar Aug 29 '17 06:08 tejaslodaya

I figured it out and it's nothing to do with anything in joe's code. My badd

@J0NNYZER0 What did you do? How did you solve it?

pi-kei avatar Oct 07 '17 00:10 pi-kei

I figured it out.

  1. Find where libjvm.so is located. /app/.jdk/jre/lib/amd64/server in my case.
  2. Add it to LD_LIBRARY_PATH env var. I'm adding this in starting script.

pi-kei avatar Oct 07 '17 12:10 pi-kei

I'm seeing this problem as well. Locally on OSX, everything is working great. When I move to ubuntu, I'm seeing the 'libjvm.so: cannot open shared object file' error. I've tried setting the follow env variables as well:

export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 export LD_LIBRARY_PATH=/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server

But no luck. All suggestions appreciated.

This is not a Heroku project.

pnahtanoj avatar Dec 02 '17 01:12 pnahtanoj

node Java is not tested with openjdk.

joeferner avatar Dec 02 '17 13:12 joeferner

@pi-kei You saved my day! Thanks !

glen-martin avatar Dec 10 '17 12:12 glen-martin