941

When I try opening Eclipse, a pop-up dialog states:

Failed to load the JNI shared library "C:/JDK/bin/client/jvm.dll"`.

Following this, Eclipse force closes.

Here's a few points I'd like to make:

  • I checked to see if anything exists at that path. It does exist.
  • My Eclipse and Java SE Development Kit are both 64-bit. I checked my system, and it can handle 64-bit.
  • I've searched for this problem on Google and on Stack Overflow, and the only answer I found was to download the 32-bit versions of JDK and Eclipse.

Downloading the 32-bit versions is something I only want to do as a very last resort.
What would be suggested to solve this issue?

Vladimir Salin
  • 2,248
  • 2
  • 33
  • 44
Mxyk
  • 10,360
  • 16
  • 52
  • 75
  • What exactly was the problem in your case? – sjas Jul 03 '12 at 22:30
  • 4
    I had, to my surprise, 5 or so Java installed onto my computer. Not only that, but it turned out that I downloaded the 32-bit Eclipse by accident. So, I uninstalled every Java I had, deleted Eclipse (Eclipse doesn't have an "uninstall"), and downloaded [Eclipse Classic 64-bit](http://www.eclipse.org/downloads/packages/eclipse-classic-42/junor) for my machine, along with a 64-bit Java (see SPP's answer for that link). – Mxyk Jul 04 '12 at 10:39
  • 2
    Also: if anyone has trouble "deleting" their Eclipse (e.g. the folder won't go away no matter how many times you remove it manually or via command prompt), try deleting it using safe mode with command prompt.. I have no idea why I had to do this, but that ended up working. – Mxyk Jul 04 '12 at 10:42
  • 1
    @MikeGates I had that problem too, used LockHunter. Obnoxious. Getting this tool to run on Windows is way too much work. – jcollum Jan 17 '13 at 23:33
  • Eclipse/Java sucks when it comes to 64bits, it is a f... disgrace. Best advice I can give is to stick to 32 bit only. Save heaps of time. – onknows Jul 17 '13 at 11:38
  • 1
    This might help - http://www.buggybread.com/2013/01/failed-to-load-jni-shared-library.html – Vivek Vermani Jan 15 '14 at 02:02
  • 1
    hey. if you DO have 64-bit version of all of the below stated software, just try deleting the 'eclipse.ini' file. worked for me:) – eiran May 15 '14 at 13:26
  • 1
    Never delete `eclipse.ini` - very bad idea. – E-Riz Jul 03 '14 at 15:57
  • 1
    Updating java fixed this problem for me. – bwoogie Dec 27 '16 at 21:59
  • These answers below, are quite good; thanks everyone! I also had the problem before; Didn't know this had a solution! thanks! – William Martens Oct 29 '20 at 19:16

39 Answers39

860

You need a 64-bit trio:

  • 64-bit OS
  • 64-bit Java
  • 64-bit Eclipse
Nicolás Alarcón Rapela
  • 1,998
  • 1
  • 13
  • 27
Grim
  • 4,939
  • 8
  • 46
  • 97
  • **Explaination**: Imagine native code (DLL) being loaded into an application. Now imagine a 32bit function wants to call a 64bit one, or alike. Same with alignment and datasizes and everything. I guess I dont have to tell anything more =P – imacake Mar 17 '12 at 17:15
  • Correctly! My laptop is running on x64 OS but I installed x86 JDK. Just installed x64 jdk and the issue go away. Thanks. – Nguyen Minh Binh Dec 02 '13 at 07:20
  • This answer is actually not totally accurate. You do **not** need to run 64-bit JDK and 64-bit Eclipse if you're on a 64-bit OS. 64-bit OS can just as well run a combo of 32-bit Java + 32-bit Eclipse. What *must* match is the bittedness of JRE/JDK and Eclipse. – E-Riz Jul 03 '14 at 15:23
  • @E-Riz You are right, a correct answer can also be "take a 32-bit eclipse!". But is it a good answer? – Grim Jul 03 '14 at 15:29
  • Whether 32-bit is "good" or not depends on a lot of context. It's certainly not "bad" since Eclipse itself does't need the extra address space that 64-bit provides. I've heard arguments that 64-bit is actually a poor choice if you don't really need it; I won't pretend to really have thought much about that, just sayin'.... – E-Riz Jul 03 '14 at 15:54
  • @E-Riz That eclipse does not need the extra address space is not absolutly right. I actually need 8GB of RAM for my MyEclipse+STS+JBDS. I think the OP has multiple kinds of java installed. Anyway this is not a chat, i refer to the last update of MikeS (21Jun) in the relation of time. – Grim Jul 03 '14 at 16:02
  • If you want that each eclipse or any other tool that is build up on eclipse run on individuals Jre then you can install those JRE right inside where your eclipse.exe is placed. For example javaw.exe should be installed on eclipseexefolder\jre\bin\javaw.exe. After this you dont need PATH variable. – himb2001 Jan 27 '15 at 05:47
  • but why if we want a 32-bit JVM in a 64-bit OS ?! how to resolve that (i must use 32-bit JVM for the Jboss tools) – Tarik Feb 11 '15 at 20:55
  • 1
    @Tarik yes, its 2015 and unfortunatelly the Visual Page Editor(VPE) of JBoss Tools still awaiting since years for a 64-bit upgrade. Look at the "Working-Pairs" answer below, at the second pair. The JBoss Tools-Plug-in is bound to the same architecture you downloaded Eclipse. So Eclipse(with the JBossTools) must be 32bit, the JDK must be 32bit and the OS can be 64 bit. A 64bit eclipse does currently not work with JBoss Tools.... I remember a project called JBossIDE that works using Eclipse, you shall use this instead of install JBossTools into eclipse. Shame on you JBoss, shame on mozilla too. – Grim Feb 12 '15 at 16:50
  • @PeterRader thanks for your clear explanation, i thought that i can't use eclipse 32 in a windows 64 because in the download page of eclipse they used the terminology _Windows 32-bit 64-bit _ which made me confused – Tarik Feb 12 '15 at 17:22
  • @Tarik ah, i see, indeed. The only reason why eclipse cares about the architecture; why eclipse can be downloaded for 32bit+64bit(cka Windows x64) and 32bit-only(cka Windows x32) is the swt-native-library binding. Also JBTools has a native binding to mozilla's native-32bit-only-library. Unfortunatelly all the native bindings must been compiled for the same architecture(because of the bigger pointers ...). But this is deep down in low-level-programming. No idea if mozilla support someday a 64bit library. – Grim Feb 12 '15 at 18:32
  • @PeterRader that's really interesting, but regarding JBTools i think there is now an Experimental support working with eclipse luna(4.1.0.Beta1)... Anyway, thanks for the additional infos :) – Tarik Feb 12 '15 at 18:45
  • Worked for me! I also made sure that the file exists in `bin/server/jvm.dll` exists, however, the problem was that I happened to download the 32-bit version. I personally am not sure about the reason, I honestly expected the 32-bit version to work too. – Kareem Jeiroudi May 21 '19 at 08:13
318

Working pairings of OS, JDK and Eclipse:


  • 32-bit OS | 32-bit JDK | 32-bit Eclipse (32-bit only)
  • 64-bit OS | 32-bit JDK | 32-bit Eclipse
  • 64-bit OS | 64-bit JDK | 64bit Eclipse (64-bit only)

I had several JDKs and JREs installed.

Each of them had their own entry in the PATH variable, all was working more or less.

Judging from the PATH variables, some installations were completely useless, since they were never used. Of course, the "inactive" Javas could be referenced manually from within Eclipse if I needed, but I never did that, so I really did not need them. (At least I thought so at that time...)

I cleaned up the mess, deinstalled all current Java's, installed only JDK + JRE 1.7 64-bit.

One of the Eclipse 'installations' failed afterwards with the Failed to Load the JNI shared Library and a given path relative to the fresh installed JDK where it thought the jvm.dll to be.

The failing Eclipse was the only one of all my IDEs that was still a 32-bit version on my otherwise all-64-bit setup.

Adding VM arguments, like so often mentioned, in the eclipse.ini was no use in my case (because I had only the wrong JDK/JRE to relate to.)

I was also unable to find out how to check if this Eclipse was a 32-bit or 64-bit version (I could not look it up in the Task Manager, since this Eclipse 'installation' would not start up. And since it had been a while since I had set it up, I could not remember its version either.)

In case you use a newer JDK and a older JRE you might be in for trouble, too, but then it is more likely a java.lang.UnsupportedClassVersionError appears, IIRC.

Nicolás Alarcón Rapela
  • 1,998
  • 1
  • 13
  • 27
sjas
  • 15,508
  • 11
  • 75
  • 80
  • 3
    It should only use the first \bin it comes to in the Path variable – ekinnear Jul 20 '12 at 18:21
  • Mmmm, that is always the question... The Oracle docs say it only uses the first one, but maybe something else was being changed/was already in place and working. Seems like its always something strange like that. – ekinnear Jul 23 '12 at 00:13
  • 8
    to check which version 32-bit or 64-bit, open eclipse.ini and look for the equinox launcher used (e.g. org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.100.v20110502) – Steve Oh Jun 06 '13 at 09:16
  • I had this combo with the error. 64-bit OS - 32-bit JDK - 32-bit Eclipse and it doesn't work. I resolved it with this combo: 64-bit OS - 64-bit JDK - 64bit Eclipse (64-bit only). The %PATH% variable has been updated to point to the 64 bit java version. Actually the %JAVA_HOME% has been updated as this variable is used into %PATH% variable values. – thanos.a Mar 29 '14 at 23:58
  • 1
    It was the comment by @ekinnear that solved my issue. I am not sure why it was looking for the JVM.dll in my windows/bin folder but putting the proper path in place seems to have resolved it. – James Mar 31 '14 at 18:58
  • My fix was also the one suggested @ekinnear. Eclipse had been working fine but I had forgotten that I had added the offending JDK to my system PATH. Once I removed the JDK from PATH , Eclipse was able to load again. – striker77 Jun 03 '15 at 09:00
269

Make sure your eclipse.ini file includes the following lines.

-vm
C:\path\to\64bit\java\bin\javaw.exe

My eclipse.ini for example:

-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.java.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
-vm
C:\Program Files\Java\jdk1.6.0_32\bin\javaw.exe
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m

Use OS and Eclipse both 64 bit or both 32 bit keep same and config eclipse.ini.

Your eclipse.ini file can be found in your eclipse folder.

Nicolás Alarcón Rapela
  • 1,998
  • 1
  • 13
  • 27
jayesh kavathiya
  • 3,507
  • 2
  • 20
  • 25
  • 9
    This solves the problem. I added the `-vm C:\Program Files\Java\jdk1.6.0_32\bin\javaw.exe` line to my eclipse.ini file and it started up just fine. Thanks for the help +1. – prolink007 Sep 10 '12 at 13:36
  • 1
    this work fine please check your version of Java, run java -version in a console and Check that this is the version being used by Eclipse or not – jayesh kavathiya Oct 10 '12 at 09:48
  • 2
    I did this with my Java 6 SDK, and it didn't work. I tried it again, pointing to my Java 7 SDK, and it worked. I'm on Windows 8 64-bit, Java 6 and 7 (both 64-bit) and Eclipse Helios (32-bit). I was ready to uninstall and re-install Eclipse 64-bit, but it seems the java 7 SDK includes some new intelligence to run 32 bit apps better. – Ryan Shillington Jan 09 '13 at 15:40
  • 9
    this works. but need to put -vm in the top of the ini file; at least before -vmargs or --launcher.xxx – pinkdawn Mar 27 '13 at 01:33
  • 3
    Very Very Important point that I missed. If you use like: "-vm C:\ProgramFiles\Java\jdk1.6.0_32\bin\javaw.exe" it will never work Correct way "-vm C:\Program Files\Java\jdk1.6.0_32\bin\javaw.exe" New line after the -vm is very important. – School Boy Dec 27 '13 at 02:11
  • No need to change the .ini file. Just use the 64 bit combo for java and eclipse – thanos.a Mar 29 '14 at 23:59
  • This has been a problem for me since I went Windows 7 64 bit in 2010. I've had to do this to every Eclipse Install since at work and home. Why have the eclipse team not addressed this issue? – Andrew S May 30 '14 at 21:52
  • As of today (July 7, 2014), this is still an issue. Is it so hard to fix this issue when eclipse already knows where your java is? – Pimgd Jul 07 '14 at 11:15
  • Configure the path in `eclipse.ini` as @jayeshkavathiya mentioned. ***RESTART ECLIPSE AFTER MAKING THE CHANGES IN eclipse.ini***. And that should solve it. :-) In my case, I could still see the error in the console. But once I restared eclipse, it vanished – Anish Nair Jul 28 '14 at 07:28
57

I had same problem

I resolved it by installing 64 bit JVM from

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

Farm
  • 3,189
  • 2
  • 27
  • 32
43

This error means that the architecture of Eclipse does not match the architecture of the Java runtime, i.e. if one is 32-bit the other must be the same, and not 64-bit.

The most reliable fix is to specify the JVM location in eclipse.ini:

-vm
C:\Program Files (x86)\Java\jdk1.7.0_55\bin\javaw.exe

Important: These two lines must come before -vmargs. Do not use quotes; spaces are allowed.

Peter Tseng
  • 11,991
  • 3
  • 64
  • 53
  • Hi, i'm working since some time ago with this .ini setup, Should i update the architecture to 64-bit or i can ignore the fact of having diferent architectures?? Thx – Billyjoker Mar 28 '15 at 13:02
32

Another option is:

Create a shortcut to the Eclipse.exe. Open the shortcut and change the target to:

"C:\Program Files\eclipse\eclipse.exe" -vm "c:\Program Files\Java\jdk1.7.0_04\bin\javaw.exe"

For your installation, make sure the locations point to the correct Eclipse installation directory and the correct javaw.exe installation directory.

(The 64/32 bit versions of Eclipse and Java need to be the same, of course.)

Peter Mortensen
  • 28,342
  • 21
  • 95
  • 123
spannow
  • 131
  • 2
  • 2
29

I have multiple versions of Java installed, both Sun JDK & JRockit, both 32 bit and 64-bit, etc. and ran into this problem with a fresh install of 64-bit Eclipse for Java EE (JUNO).

What did NOT work:

64-bit trio as suggested by Peter Rader:

I'm using 64-bit Eclipse on 64-bit OS (Windows 7).

I ensured Sun JDK 7 64-bit was the default java version. When I typed "java -version" from command line (cmd.exe), Sun JDK 7 64-bit was returned...

java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)

This did not resolve the problem for me.

What DID work:

Adding -vm option to eclipse.ini as suggested by Jayesh Kavathiya:

I added the following to eclipse.ini:

-vm
C:/apps/java/jdk7-64bit/bin/javaw.exe

Note:

I did not have to uninstall any of the various versions of JDK or JRE I have on my machine.

Sunny Sarkar
  • 99
  • 2
  • 2
  • I did not have to uninstall the JDK's either, but I chose to clean my system to wipe out future error causes. I had also mentioned the VM arguments, and explained why they could obviously not work for me. It is your choice how you want to set up your system, depending on what you _really_ need. – sjas Oct 08 '12 at 15:09
  • I had to do both things, but adding the javaw.exe line then led me to install everything on 64 bit, anyways. It depends on how much karma punishment you are due to pay to android. – Josh Aug 12 '14 at 08:16
  • I have been developing for years, and with no change to my system (that I am aware of), Eclipse throws this error. Adding the -vm option sorted it out for me, without needing to change any other settings or un/re/install anything. – Knossos Apr 22 '15 at 05:40
18

For a missing jvm.dll file, we can provide the path of the dll file in eclipse.ini file as

-vm
C:\Progra~1\Java\jdk1.6.0_38\jre\bin\server\jvm.dll

Here it is important to remove any space in the path and the double quotes. It worked for me when i removed the quotes and space.

I hope it helps someone.

Stalin Gino
  • 572
  • 9
  • 28
11

I had a similar problem. It was solved doing the following.

  • Move Eclipse to Program Files (not to Program Files (x86)).
  • Remove the path to the 32-bit version of Java from the 'path' environment variable.

I have both versions of Java installed, but Eclipse kept trying to use the 32-bit one.

Peter Mortensen
  • 28,342
  • 21
  • 95
  • 123
misterfrb
  • 205
  • 2
  • 10
10

Sure, you need to have a compatible version of JDK and Eclipse, but you also need to add in the eclipse.ini file the below lines:

-vm
yourdrive\java\bin

Make them the first two lines of your eclipse.ini file.

Peter Mortensen
  • 28,342
  • 21
  • 95
  • 123
Deepak Tyagi
  • 31
  • 1
  • 2
7

The answers above me got me tempted so much, that I decided to dry run all the possible combinations with OS, Eclipse and JVM trio. Anyway, whoever is digging down and reading my post, check the following as a hot spot (I am Windows 7 user).

  1. You understand Program Files and Program File (x86) are two different folders... x86 stands for the 32-bit version of programs and the former is the 64-bit version.

  2. If you have multiple versions of Java installed with different bitness and release versions, which is bound to happen with so many open source IDEs, managers, administrative consoles, the best option is to set the VM argument directly in the eclipse.ini file. If you don't, Eclipse will go crazy and try searching itself which is not good.

Andrew Barber
  • 37,547
  • 20
  • 91
  • 118
sayannayas
  • 734
  • 9
  • 15
7

As many folks already alluded to, this is a 32 vs. 64 bit problem for both Eclipse and Java. You cannot mix up 32 and 64 bit. Since Eclipse doesn't use JAVA_HOME, you'll likely have to alter your PATH prior to launching Eclipse to ensure you are using not only the appropriate version of Java, but also if 32 or 64 bit (or modify the INI file as Jayath noted).

If you are installing Eclipse from a company-share, you should ensure you can tell which Eclipse version you are unzipping, and unzip to the appropriate Program Files directory to help keep track of which is which, then change the PATH (either permanently via (Windows) Control Panel -> System or set PATH=/path/to/32 or 64bit/java/bin;%PATH% (maybe create a batch file if you don't want to set it in your system and/or user environment variables). Remember, 32-bit is in Program files (x86).

If unsure, just launch Eclipse, if you get the error, change your PATH to the other 'bit' version of Java, and then try again. Then move the Eclipse directory to the appropriate Program Files directory.

Peter Mortensen
  • 28,342
  • 21
  • 95
  • 123
Marc Towersap
  • 381
  • 2
  • 4
  • It's clearly a problem as this page as 700k views currently... and a year later there's apparently no fix for it that doesn't involve poking around in environment variables just to get the IDE to run! – Ciaran Gallagher Dec 02 '14 at 15:23
6

Alternatively, get the same "bit" version of JRE and Eclipse and then create a new shortcut with the below target (replace the installed JRE and Eclipse location/path):

"C:\studio\eclipse.exe" -vm "C:\Program Files\Java\jre7\bin\server\jvm.dll" eclipse.vm="C:\Program Files\Java\jre7\bin\server\jvm.dll" java.home="C:\Program Files\Java\jre7" java.runtime.version=1.7.0

That should do the trick.

Peter Mortensen
  • 28,342
  • 21
  • 95
  • 123
Kevin Yap
  • 31
  • 1
  • 1
6

You can solve that problem as many other replicated. You need that Eclipse and the JDK be 32-bits or both on 64-bits. The architecture of the OS doesn't matter while the others remains on the same type of arquitecture.

Peter Mortensen
  • 28,342
  • 21
  • 95
  • 123
Ignacio
  • 41
  • 1
  • 3
5

One of the easy ways to resolve it is to copy the jre folder from installed the JDK into the Eclipse installation folder. Make sure that JDK you copy from is the same architecture as your Eclipse installation.

I had to configure my machine that way, because I run both Eclipse and Appcelerator Titanium Studio on my machine. The Studio needs 32-bit Java, while Eclipse needs 64-bit.

Peter Mortensen
  • 28,342
  • 21
  • 95
  • 123
Mike Starov
  • 6,201
  • 7
  • 33
  • 37
  • I did the same thing a long time ago, but for eclipse-jee-juno-SR1-win32 and Java6, I could not get it to work, this time around. Did you also edit the eclipse.ini with an absolute path to the jre ? – user77115 Oct 10 '12 at 03:25
  • I also have Eclipse 64 width jdk 7 64bit, but titanium tall me it's unable to load jni shared dll. – realtebo Apr 19 '13 at 14:25
  • Because of Window's crazy autoupdates, whenever there is an update for JAVA, it blocks my Eclipe from launching. Above solution is the easiest way to work independently without caring about autoupdates. Thanks! – Jyo the Whiff Feb 28 '19 at 12:27
4

Yes, just make sure your versions of Eclipse and JDK are both 64-bit. Just to make sure everything is correct uninstalled JDK and install it in Program Files and not in Program Files (x86). At least that resolved my problem.

Peter Mortensen
  • 28,342
  • 21
  • 95
  • 123
Jeena
  • 199
  • 1
  • 3
  • 14
4

Just check the PATH environment variable. In My Computer - > Properties -> Advanced System settings -> Environment Variables -> (left upper window "User Variables for "some name of PC"" ) just check the PATH variable. If it doesn't exist create it with the following -- > C:\Program Files (x86)\Java\jre7\bin <--

I was faced with the same problem after had updated my Eclipse. I've found that the path asked 64-bit version, but I had the 32-bit in dif path. It was helpful for me. P.S.: I have a 64-bit OS, 32-bit JRE and 32-bit Eclipse. All works fine :)

Peter Mortensen
  • 28,342
  • 21
  • 95
  • 123
user1600401
  • 37
  • 1
  • 3
4

You should uninstall all old [JREs][1] and then install the newest one... I had the same problem and now I solve it. I've:

Better install Jre 6 32 bit. It really works.

Community
  • 1
  • 1
Marcin Erbel
  • 1,465
  • 5
  • 30
  • 50
3

Downloaded 64 bit JVM from site and installed it manually and updated the system path variable. That solved the issue.

  1. Default JVM is installed in my system was in "C:\Program Files
    (x86)\Java\jre7"
  2. Manually installed JVM got installed in "C:\Program Files\Java\jre7" and after updating this pate to system path variable it worked.
Satya
  • 2,819
  • 2
  • 17
  • 25
3

Simple, I have a 64-bit OS, 32-bit Eclipse and both JDK 32 & 64 installed... I just uninstalled the 64-bit JDK and Eclipse is working fine..

Peter Mortensen
  • 28,342
  • 21
  • 95
  • 123
3

I had the same issue after upgrading from Java 6 to Java 7. After I removed Java 6 (64 bit) and reinstalled Java 7 (64 bit), Eclipse worked. :)

Peter Mortensen
  • 28,342
  • 21
  • 95
  • 123
Supun Sameera
  • 2,553
  • 3
  • 15
  • 13
3

It is crucial to add the -vm parameter and its value on 2 lines AT THE BEGINNING of the eclipse.ini

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

Rolf
  • 402
  • 3
  • 9
3

You have change proper version of the JAVA_HOME and PATH in environmental variables.

Sreedhar GS
  • 2,461
  • 1
  • 19
  • 26
  • Worked well for me. I've installed multiple Java versions to test and the Path and JAVA_HOME wasn't pointing to the same installation. My Solution: Changed the Path to "%JAVA_HOME%\bin" – Helcio R. Macedo Pandelo Dec 04 '20 at 18:21
3

I want to previde another solution for this error, especially for who want to use 32-bit and 64-bit Eclipse in one system.

Eclipse will startup using the JRE/JDK in jre sub-directory if it exists. (STS or other eclipse based IDE also support this feature...)

The solution is create directory junction using mklink.exe command which exist in windows vista or newer version (junction.exe offer similar function for Windows 2000/XP)
Open the command line windows and exeute following command:

mklink /j "$ECLIPSE-HOME/jre" "$JDK_or_JRE_home"

Of course, if the Eclipse is for 64-bit Windows, the architecture of JDK/JRE must be the same.

Assume:

  • Eclipse for windows x86_64 is installed in d:\devTool\eclipse
  • JDK for windows x64 is installed in C:\Program Files\Java\jdk1.8.0

The command for creating the jre folder will be:

mklink /j "d:\devTool\eclipse\jre" "C:\Program Files\Java\jdk1.8.0"

BTW, delete directory junction will NOT delete any file. If you create a wrong link, you can delete it using file explorer or rmdir command.

rmdir "d:\devTool\eclipse\jre"

Beck Yang
  • 2,874
  • 2
  • 17
  • 25
3

Thank you misterfrb, I realised that Eclipse was giving this error, because I had just installed Oracle 10g Developer suite, and it was looking for the jvm.dll file in the C:\DevSuiteHome_1 folder (I must have opted to install JDK again along with developer suite).

After removing the DevSuiteHome lines from the paths variable and adding the correction location for 64-bit jvm.dll (not sure if this was necessary, didn't try without), Eclipse worked again, and Developer suite still does too.

Peter Mortensen
  • 28,342
  • 21
  • 95
  • 123
Unegma
  • 41
  • 2
2

Make sure you are starting Eclipse with Administrator rights.

Peter O.
  • 28,965
  • 14
  • 72
  • 87
2

If you use whole 64-bit trio and it still doesn't work (I've come to this problem while launching Android Monitor in Intellij Idea), probably wrong jvm.dll is being used opposed to what your java expects. Just follow these steps:

  1. Find the jvm.dll in your JRE directory: C:\Program Files\Java\jre7\server\bin\jvm.dll

  2. Find the jvm.dll in your JDK directory: c:\Program Files\Java\jdk1.7.0_xx\jre\bin\server\

  3. Copy the jvm.dll from JRE drectory into your JDK directory and overwrite the jvm.dll in JDK.

Don't forget to make a backup, just in case. No need to install or uninstall anything related to Java.

rootpd
  • 197
  • 9
2

The same occurred to me. I had 64-bit Eclipse, but my JDK was 32-bit. So I installed the 64-bit version and it's OK right now.

felipe.zkn
  • 1,804
  • 7
  • 28
  • 62
2

I'm not sure why but I had the jre installed into my c:\windows directory and java.exe and javaw.exe inside my windows\system32 directory.

Obviously these directories were getting priority even AFTER adding the -vm flag to my eclipse.ini file.

Delete them from here fixed the issue for me.

Guy Lowe
  • 1,853
  • 1
  • 20
  • 35
1

You can install the 32-bit version of JDK on a 64-bit machine. See JDK 7 downloads.

Peter Mortensen
  • 28,342
  • 21
  • 95
  • 123
  • 1
    Your answer is not helpful. It is already known that this is possible. The OP wants to avoid it. – nalply Oct 05 '12 at 18:51
1

On the download page of Eclipse, it should be written "JRE 32 bits" or "JRE 64 bits" and not "Windows 32 bits" or "Windows 64 bits".

Be sure to use the correct version compatible with your JDE, as answered previously.

A_rnO
  • 141
  • 1
  • 5
1

And for PDT users - avoid the Zend download page - it doesn't have any 64-bit downloads linked.

Use the Elipse site itself.

The above link had an older 3.6 Eclipse which then failed to update itself due to Eclipse Bug #317785.

My solution was to just install 32-bit Java alongside 64-bit - this allowed the Zend installer to work.

It's depressing that amount of Java / Eclipse cruft one has to go through to get a PHP IDE.

Peter Mortensen
  • 28,342
  • 21
  • 95
  • 123
cloakedninjas
  • 3,346
  • 1
  • 27
  • 41
1

In my case, I tried to launch java from the command prompt and got this error

Error: could not open "C:\Windows\jre\lib\amd64\jvm.cfg"

It meant "java" was looked for in the PATH starting at this wrong directory. Deleting the folder C:\Windows\jre\ solved the issue

Federico Giorgi
  • 9,409
  • 9
  • 38
  • 50
0

I had the same problem. with 64bit os all should be 64bit. Java and Eclipse. I tried all the methods in stackoverflow and also in youtube. non of them worked for me untill i found this easy method.

I installed 64bit java form Cnet download and the problem was automatically fixed. I mentioned the source because it is too easy to google and go to first Cnet lint rather than oficial site if you are a new bee.

p.s. if you have Android ADT bundle and tried to open eclipse from it and got the same error, you can fix that problem too with this method.

Priyankara
  • 720
  • 11
  • 21
0

The easiest solution is to include a specific JRE in eclipse.ini:

wiki.eclipse.org/Eclipse.ini

With this, you can start almost any Eclipse version

keesp
  • 173
  • 11
  • I realy like this answer because it refers official documentation. Right now the link looks broken. I would be pleased if you update the link. – Grim Jul 03 '14 at 15:39
0

This error we are getting because of different Java version download 32-bit version.

vaquar khan
  • 8,163
  • 4
  • 54
  • 73
0

Installing JDK 1.8._91 (mixed mode) is another solution for this!

0

This happens because of the way the windows paths interact. Your 32-bit JRE is listed BEFORE your 64-bit version. Since javaw.exe is named the same for both 32 and 64 bit versions, it tries the first one it finds. Change the order in your Path Environmental variables, so the 64-bit version higher on the list than the 32-bit, and it will work correctly.

Beachhouse
  • 4,626
  • 3
  • 22
  • 35
-1

I have experienced all of the Eclipse errors and this is one of them. The problem is Eclipse 64-bit version. Download the 32-bit version and launch it.

Peter Mortensen
  • 28,342
  • 21
  • 95
  • 123
sadegh saati
  • 1,148
  • 1
  • 13
  • 22