“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:”

The reason you’re getting this error is that Eclipse cannot find Java on your system. Well first things first. To start with you don’t need the full blown  Java Development Kit, you just need the JRE (Java Run-time Environment) a much smaller package.

If you go to Java.com, there is a danger of downloading the 32-bit instead of a 64-bit version (assuming you are running a 64-bit Windows OS. If you click on the “Free Java Download” button you will be taken to this screen:

dont do this

Go to Java.com

Being so simple, I was fully expecting it to detect my OS as 64-bit Windows 8 and automatically download and install the appropriate version. Sadly as of writing this article, this is not what happens. I found a 64-bit version of Java simply by ‘Googling’ download 64 bit java and ‘download.cnet.com’ had what I was after. You’ll know you’ve got the right version if it installs to a folder in Program Files, rather than Program Files (x86).

To get things working properly you need a 64-bit trio:

  • 64-bit OS
  • 64-bit Java
  • 64-bit Eclipse

http://download.cnet.com/Java-Runtime-Environment-JRE-64-Bit/3000-2378_4-75317067.html

 

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

failed-jni

You’ll only see this if you’re running a 32-bit Java install on a 64-bit OS with 64-bit Eclipse and you’ve also set the PATH variable up correctly. Go ahead and remove the 32-bit Java and install a true 64-bit Java instead.

Once you’ve successfully installed the correct version of Java and you try to run Eclipse you’ll still get exactly the same error as last time, namely:

“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:”

This is because for Windows to know where to find the Java Run-time, it needs to know explicitly where Java has been installed. This is a manual process as the Java installer does not do this automatically for you.

For me on Windows 8 (the process is similar on Windows 7 and earlier versions) is to right-click on ‘My Computer’ > Properties > Advanced System Settings > Environment Variables…

environment-variables

The lower window contains a list under the name ‘System Variables’. Scroll down until you see a variable called PATH.

With PATH selected click edit. What you need to do now is just to add the location of your Java run-time files. For me this was ;C:\Program Files\Java\jre7\bin

The ; before the C needs to be added because you are specifying another location to the PATH variable. Once this has been done click OK. You do not need to restart your system and you should now be able to click on the location of your  eclipse.exe and be up and running!

🙂

andriod-java-sucessful