运行Eclipse出错:Failed to load the JNI shared library

运行Android的ADT,即Eclipse出错:

Failed to load the JNI shared library

C:\Program Files (x86)\Java\jre6\bin\client\jvm.dll




其中背景是:

1.之前已经可以正常运行的,即已经正常安装了JRE6的。

2.后来删除掉了JRE6了。

3.刚刚又去重新安装了JRE6,结果还是错误依旧。

4.并且已经确定了:

C:\Program Files (x86)\Java\jre6\bin\client\jvm.dll

是存在的。

 

【解决过程】

1.现在想办法搞清楚,为何还是不行。

难道需要重启电脑才可以???

2.去随便看了看,当前的eclipse的配置:

D:\tmp\tmp_dev_root\android\adt-bundle-windows\eclipse\eclipse.ini


其中背景是:

1.之前已经可以正常运行的,即已经正常安装了JRE6的。

2.后来删除掉了JRE6了。

3.刚刚又去重新安装了JRE6,结果还是错误依旧。

4.并且已经确定了:

C:\Program Files (x86)\Java\jre6\bin\client\jvm.dll

是存在的。

 

【解决过程】

1.现在想办法搞清楚,为何还是不行。

难道需要重启电脑才可以???

2.去随便看了看,当前的eclipse的配置:

D:\tmp\tmp_dev_root\android\adt-bundle-windows\eclipse\eclipse.ini

其中背景是:

1.之前已经可以正常运行的,即已经正常安装了JRE6的。

2.后来删除掉了JRE6了。

3.刚刚又去重新安装了JRE6,结果还是错误依旧。

4.并且已经确定了:

C:\Program Files (x86)\Java\jre6\bin\client\jvm.dll

是存在的。

 

【解决过程】

1.现在想办法搞清楚,为何还是不行。

难道需要重启电脑才可以???

2.去随便看了看,当前的eclipse的配置:

D:\tmp\tmp_dev_root\android\adt-bundle-windows\eclipse\eclipse.ini


其中背景是:

1.之前已经可以正常运行的,即已经正常安装了JRE6的。

2.后来删除掉了JRE6了。

3.刚刚又去重新安装了JRE6,结果还是错误依旧。

4.并且已经确定了:

C:\Program Files (x86)\Java\jre6\bin\client\jvm.dll

是存在的。

 

【解决过程】

1.现在想办法搞清楚,为何还是不行。

难道需要重启电脑才可以???

2.去随便看了看,当前的eclipse的配置:

D:\tmp\tmp_dev_root\android\adt-bundle-windows\eclipse\eclipse.ini


其中背景是:

1.之前已经可以正常运行的,即已经正常安装了JRE6的。

2.后来删除掉了JRE6了。

3.刚刚又去重新安装了JRE6,结果还是错误依旧。

4.并且已经确定了:

C:\Program Files (x86)\Java\jre6\bin\client\jvm.dll

是存在的。

 

【解决过程】

1.现在想办法搞清楚,为何还是不行。

难道需要重启电脑才可以???

2.去随便看了看,当前的eclipse的配置:

D:\tmp\tmp_dev_root\android\adt-bundle-windows\eclipse\eclipse.ini

JAVA_HOME=C:\Program Files (x86)\Java\jre6

所以,始终找不到对应的值,现在把其改为:

JAVA_HOME=C:\Program Files\Java\jdk1.6.0

并且,PATH中,也已经有了:

%JAVA_HOME%\bin

这样,应该就可以了。

去试了试,果然可以了,可以正常运行Eclipse,此处的ADT了:

总结】

当运行基于Java的东西,此处是Eclipse(用于开发Android的ADT),如果出现:

Failed to load the JNI shared library

C:\Program Files (x86)\Java\jre6\bin\client\jvm.dll

之类的问题时,则很简单,

先:

  • 去看看,对应的路径中,是否真的存在jvm.dll
    • 如果没有,那很明显,需要自己去安装对应的版本
      • 自己去Oracle官网下载,对应的版本的,JRE或JDK
        • 比如我的是,x64的Win7,下载了个:jdk-6-windows-amd64.exe
  • 再去确认一下Java的环境变量是否正常:
    • JAVA_HOME:应该是你的JRE或者JDK的安装路径
      • 比如我这里,64位的win7,安装的是64位的JDK 6,所以安装后,对应路径为:
        C:\Program Files\Java\jdk1.6.0
    • PATH:path中应该包含java的bin目录,类似于
      C:\Program Files (x86)\Java\jre6\bin\
      • 提示:但是由于已经设置好了JAVA_HOME了,所以可以更加通用的写为
        %JAVA_HOME%\bin

另外,提示一下:

64位的(Win7)系统中,对应的软件安装目录:

  • 32位的软件,默认安装到:C:\Program Files (x86)\
  • 64位的软件,默认安装到:C:\Program Files\

转载请注明:在路上 » 【已解决】运行Eclipse出错:Failed to load the JNI shared library


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
This error message typically occurs when a Java program is unable to load the Java Native Interface (JNI) shared library. The JNI is a programming framework that allows Java programs to interact with native applications and libraries written in languages such as C and C++. Here are some possible reasons for this error: 1. Missing or incorrect library path: The JVM may not be able to find the JNI library because the library path is not set correctly or the library file is missing. 2. Wrong architecture: The JVM may be trying to load a JNI library that is not compatible with the architecture of the system. For example, if the JVM is 64-bit and the JNI library is 32-bit, it will not be able to load the library. 3. Incompatible Java version: The JNI library may not be compatible with the version of Java that is installed on the system. 4. Corrupted library file: The JNI library file may be corrupted, which can prevent it from loading correctly. To resolve this error, you can try the following: 1. Check the library path: Ensure that the library path is set correctly and that the JNI library file exists in the path. 2. Check the architecture: Ensure that the JNI library file is compatible with the architecture of the system. 3. Check the Java version: Ensure that the version of Java installed on the system is compatible with the JNI library. 4. Reinstall the library: Try reinstalling the JNI library to ensure that it is not corrupted. If none of these solutions work, you may need to consult the documentation for the specific Java program you are using or contact the developer for further assistance.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值