tags:

views:

61

answers:

3

I recently uninstalled and then reinstalled Java on my machine and ever since, Eclipse just does not start up. I find this weird, because I uninstalled a different version of Java from the one that I use. I modified the eclipse.ini file, by adding the following:

-vm

C:\Program Files (x86)\Java\jre1.5.0_15\bin\javaw.exe

This made no difference. I then tried to reset the JAVA_HOME variable and I tried both these things again, after reinstalling (well, unzipping) Eclipse again. None of this made any difference, which is why I'm posting this question. Can someone help me out here?

A: 

You need to make sure that the path to javaw.exe is in %PATH% environment variable. Basically:

%PATH% = %PATH%;c:\path\to\jre\bin

You can configure this in the environment variables configuration and you can verify this by opening a command prompt and test if java is recognized as a command from inside an arbitrary path.

The %JAVA_HOME% should by the way point to the JDK's /bin folder, not the one of the JRE. Regardless, this environment variable is ignored by Eclipse since it comes with its own compiler.

BalusC
The %JAVA_HOME% points to the JDK's bin folder. Could you tell me how exactly to configure the environment variables include the path to javaw.exe?
efficiencyIsBliss
I have no idea what Windows version you're using, so here's just a [WinXP](http://support.microsoft.com/kb/310519) targeted document. How about calling `java` in cmd?
BalusC
A: 

You may also try eclipse.exe -vm "c:\path\to\jre\bin"

Ankur
That sorta got it to run. I got the following error message: `Failed to load JNI shared library "C\path\to\jvm.dll"`
efficiencyIsBliss
I assume you have already check that jvm.dll exists in \jre\bin\classic and \jre\bin\j9vm folders. The more possible reason seems to be either JRE/JDK or the eclipse is not matching the OS (32 bit or 64 bit). I am guessing this based on the similar problem posted here http://www.satya-weblog.com/2010/07/eclipse-error-failed-to-load-the-jni-shared-library-cprogram-files-x86javajre6binclientjvm-dll.html.
Ankur
A: 

I uninstalled all the versions of Java I had installed and installed them again. I also deleted Eclipse and downloaded that again. Following this, I edited the eclipse.ini file to include the path the javaw.exe, as I mentioned in the question. Everything works fine now.

efficiencyIsBliss