Eclipse: annoying 32/64-bit installation issues

I just installed Eclipse on my new computer that’s running windows 8 and I ran into some problems. First I got the following error message:

---------------------------
Eclipse
---------------------------
A Java Runtime Environment (JRE) or Java Development Kit (JDK)
must be available in order to run Eclipse. No Java virtual machine
was found after searching the following locations:
C:\eclipse\jre\bin\javaw.exe
javaw.exe in your current PATH
---------------------------
OK
---------------------------

This was due to the fact that I had actually forgotten to install java which was needed 🙂
I installed java and changed the eclipse ini-file to include the path to the JRE:

-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20130521-0416
-product
org.eclipse.epp.package.standard.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vm
C:\Program Files(x86)\Java\jre7\bin\javaw.exe
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Xms40m
-Xmx512m

I then got the following error message:

---------------------------
Eclipse
---------------------------
Java was started but returned exit code=13
C:\Program Files (x86)\Java\jre7\bin\javaw.exe
-Dosgi.requiredJavaVersion=1.6
-Xms40m
-Xmx512m
-XX:MaxPermSize=256m
-jar C:\eclipse\\plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
-os win32
-ws win32
-arch x86_64
-showsplash C:\eclipse\\plugins\org.eclipse.platform_4.3.0.v20130605-2000\splash.bmp
-launcher C:\eclipse\eclipse.exe
-name Eclipse
--launcher.library C:\eclipse\\plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20130521-0416\eclipse_1503.dll
-startup C:\eclipse\\plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
--launcher.appendVmargs
-exitdata 1868_44
-product org.eclipse.epp.package.standard.product
-vm C:\Program Files (x86)\Java\jre7\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Xms40m
-Xmx512m
-XX:MaxPermSize=256m
-jar C:\eclipse\\plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
---------------------------
OK
---------------------------

I searched the internet and I found out that I had, for some inexplicable reason, installed a 32-bit version of Java on my 64-bit system. Why? Well, it turned out that my browser was a 32-bit version of Chrome and so when I entered java.com and downloaded the installation package they handed me a 32-bit package which I installed. The fact that the path to the JRE included “Program Files(x86)” should probably have been a clue, but no.
I read up and it turned out I had to install both a 32-bit version and a 64-bit version and feed eclipse, which I downloaded as a 64-bit version, the path to the 64-bit JRE installation.

Then it worked fine 🙂