Eclipse failed to Load after installing new JRE.

Sometime as a developer you may change your setting/JRE or JDK for testing and then other Java tools like Eclipse stop working. For example:

Failed to load the JNI shared library “c:\Program Files (x86)\Java\jre7\client\jvm.dll

If Eclipse was working and then all of a sudden it stops, it can be the JRE version, the path order or simply a conflict between version etc.

Looking at my Java version for JRE7 I find

C:\Users\Steve Robinson>java -d64 -version

Error: This Java instance does not support a 64-bit JVM.

Please install the desired version.

We can clearly see that the JRE that was last installed has set the Java Path to a 32 bit version.

What we can do is downloading and install a 64 bit version. Also what we can also do is tell my 64Bit Eclipse version by adding a -vm parameter to eclipse.ini, but using the reference below we may have to use thr JRE or JDK.

vm value: Windows Example

This is how the -vm argument might look on Windows (your exact path to javaw.exe could be different, of course):

-vm

C:\Java\JDK\1.7\bin\javaw.exe


This might not work on all systems. If you encounter “Java was started but returned exit code=1” error while starting the eclipse, modify the
-vm argument to point to jvm.dll (exact path could be different):

-vm

C:\Development\Java\64bit\jdk1.7.0_09\jre\bin\server\jvm.dll

Using the eclipse.ini is best as it can override any confusion in your paths as required for other apps/tools.

Here is an example of an eclipse.ini specifying my location of a 64bit JDK

-startup

plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar

–launcher.library

plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.2.R36x_v20101222

-product

org.eclipse.epp.package.php.product

–launcher.defaultAction

openFile

–launcher.XXMaxPermSize

256M

-showsplash

org.eclipse.platform

–launcher.XXMaxPermSize

256m

–launcher.defaultAction

openFile

-vm

C:\Program Files\Java\jdk1.7.0_21\jre\bin\server\jvm.dll

-vmargs

-Dosgi.requiredJavaVersion=1.5

-Xms40m

-Xmx384m

References:

http://wiki.eclipse.org/Eclipse.ini

Facebooktwittergoogle_plusredditpinterestlinkedinmail

Leave a Reply