Java 无法加载 JNI 共享库

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20932377/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 05:24:23  来源:igfitidea点击:

Failed to load JNI shared library

javaeclipse

提问by mukesh

When I am trying to start my STS editor, I received a message as pop-up window open and said that

当我尝试启动 STS 编辑器时,在弹出窗口打开时收到一条消息并说

Failed to load the JNI shared library "C:\Program Files\Java\jdk1.7.0\bin...\jre\bin\server\jvm.dll

无法加载 JNI 共享库“C:\Program Files\Java\jdk1.7.0\bin...\jre\bin\server\jvm.dll

Here i am posting my STS.ini below.

在这里,我在下面发布我的 STS.ini。

-vm
C:\Program Files\Java\jdk1.7.0_21\bin
-startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
–launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.100.v20110502
-product
com.springsource.sts.ide
–launcher.defaultAction
openFile
–launcher.XXMaxPermSize
384M
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Xmn128m
-Xms256m
-Xmx768m
-Xss4m
-XX:PermSize=128m
-XX:MaxPermSize=384m
-XX:CompileThreshold=1000
-XX:+CMSIncrementalPacing
-XX:+UnlockExperimentalVMOptions
-XX:+UseG1GC
-XX:+UseFastAccessorMethods

回答by Taoufik Mohdit

The -vm option must specify the full absolute or relative path to the Java executable, not just to the Java home directory. In Windows that would be:

-vm 选项必须指定Java 可执行文件的完整绝对或相对路径,而不仅仅是 Java 主目录。在 Windows 中,这将是:

-vm
C:\Program Files\Java\jdk1.7.0_21\bin\javaw.exe

Also I would move the -vmoption to be immediately before the -vmargsoption:

此外,我会将-vm选项移动到选项之前-vmargs

...
–launcher.XXMaxPermSize
384M
-vm
C:\Program Files\Java\jdk1.7.0_21\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.6
...

More details can be found here: http://wiki.eclipse.org/Eclipse.ini#Specifying_the_JVM

更多细节可以在这里找到:http: //wiki.eclipse.org/Eclipse.ini#Specifying_the_JVM

回答by Mehedi hasan

I am using Windows 7 64bit and my eclipse was 32 bit. i face the problem showing this message when want to open my eclipse

我使用的是 Windows 7 64 位,而我的 Eclipse 是 32 位。当我想打开我的日食时,我遇到了显示此消息的问题

Failed to load the JNI shared library "C:\Program Files\Java\jdk1.7.0\bin...\jre\bin\server\jvm.dll

now i install 32bit JVM from below link and install it.

现在我从下面的链接安装 32 位 JVM 并安装它。

http://www.java.com/en/download/manual.jsp

http://www.java.com/en/download/manual.jsp

Then i just set PATH from Environment variables

然后我只是从环境变量设置 PATH

C:\Program Files (x86)\Java\jre1.8.0_25\bin

Now it's work for me!!!

现在它对我有用!!!