I am trying to get my first taste of Android development using Eclipse. I ran into this problem when trying to run Eclipse, having installed version 4.2 only minutes ago.
I got this error and found that my PATH variable (on Windows) was probably changed. First in my PATH was this entry:
C:\ProgramData\Oracle\Java\javapath
...and Eclipse ran "C:\ProgramData\Oracle\Java\javapath\javaw"
- which gave the error. I suspect that this is something that came along with an installation of Java 8.
I have several Java versions installed (6,7 and 8), so I removed that entry from the PATH and tried to restart Eclipse again, which worked fine.
If it's doesn't work for you, you'll need to upgrade your JDK (to the Java versions - 8 in this case).
Instructions on how to edit PATH variable
I had the same issue after I upgraded my JDK from 1.7 to 1.8. I'm using Eclipse 4.4 (Luna). The error is gone after I degrade JDK to 1.7.
If you install a 64-bit Eclipse version on a PC with a 32-bit JRE this is guaranteed to occur.
So the solution is quite straightforward: You need to synchronise them by updating either one. This shall happen when downloading Oracle Fusion middleware and Eclipse expects a 32-bit environment while your JRE is 64-bit and your JAVA home is pointing to a 64-bit JDK.
Make sure you don't have special characters (%
, $
, #
, etc.) at Eclipse path.
I have just solved the same issue upon setting up my Windows 8.1 PC. Exactly like @George Papatheodorou mentioned above (sorry I cannot add a comment), Eclipse and JRE must be both 64 bit or 32 bit.
However, it seems for Windows 8/8.1 environment, you are going to get 32-bit JRE by default (and I do not know where to change that default for the download), as explained here: http://java.com/en/download/faq/win8_faq.xml
I was using 64-bit Eclipse so there was a discrepancy. I then installed 32-bit Eclipse and everything works fine this time.
So before bothering changing any environment variables, check your JRE and Eclipse version.
Of course you can use 64-bit JRE with 64-bit Eclipse. Just make sure they match because Windows 8.1 will give you 32-bit by default.
If you have recently installed Java 8 and uninstalled Java 7, install JDK 8 and retry.