[英]node-java error: libjvm.so: cannot open shared object file: No such file or directory
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我在以下节点插件中遇到错误并打开了一个问题:插件在这里: https : //github.com/joeferner/node-java问题在这里: https : //github.com/joeferner/node-java /问题/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我看到在 SO 上解决了关于使用 rStudio 的开发人员的类似问题: libjvm.so:无法打开共享对象文件:没有这样的文件或目录
I am having a similar error when I launch my node app to heroku:当我将我的节点应用程序启动到 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)
It looks like you'll need to set the JAVA_HOME
environment variable like this:看起来您需要像这样设置JAVA_HOME
环境变量:
$ heroku config:set JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64"
This is because you are using the stack JDK (the default JDK).这是因为您使用的是堆栈 JDK(默认 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:您还可以通过将 jvm-common buildpack 添加到您的应用程序来使用自定义 JDK(通常是较新版本),这也会为您设置JAVA_HOME
:
$ heroku buildpacks:clear
$ heroku buildpacks:add https://github.com/heroku/heroku-buildpack-jvm-common
$ heroku buildpacks:add heroku/nodejs
Then redeploy with git push
.然后使用git push
重新部署。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.