Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jonnydungeons opened this issue Mar 23, 2016 · 10 comments

Comments

@jonnydungeons
Copy link

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
Copy link
Author

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
Copy link
Author

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

@melvinmmw
Copy link

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

@jude-liu
Copy link

@J0NNYZER0 How can you solve this problem?

@tejaslodaya
Copy link

tejaslodaya commented Aug 29, 2017

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

@pi-kei
Copy link

pi-kei commented Oct 7, 2017

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
Copy link

pi-kei commented Oct 7, 2017

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.

@pnahtanoj
Copy link

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.

@joeferner
Copy link
Owner

node Java is not tested with openjdk.

@glen-martin
Copy link

@pi-kei You saved my day! Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants