Wednesday, May 20, 2015

Eclipse - That start up problem..

Recently, when I was trying to load Eclipse IDE, I was getting error that said:

"Version 1.6.0 of the JVM is not suitable for this product"

It also stated that it requires VM 1.7 or higher to run the Eclipse IDE.

When I checked my default installation (by going to start->command prompt-> and then running "java -version"), I figured out that the default was 1.6.

What I did was to install Java 1.7 from the regular download website. (You can download Java SE from Oracle website).

I was running Windows 64 bit. So I downloaded 64 bit JDK run time and installed the same. I was still seeing the problem. Later I noticed that Eclipse I downloaded was 32 bit one. Theoretically, it must also be running on 64 bit JDK. But for some reasons it was failing to pick up the newly installed JDK.

I was checking eclipse.ini file if there had been any mention of path for the 'java' executable to be picked up. There wasn't any.

Rather than solving this problem, I could think of a better solution:

1. Instead of installing the required JDK on to the system as default system JVM, I thought I better download a standalone JDK (so I can keep changing the same in future too) and make eclipse pointing to that JDK to make it running. - So I did this step.

2. Now the step is to make eclipse to pick up java from this standalone installation. (ie., picking up java from unzipped sdk directory). That can be done by means of adding the following lines in your eclipse.ini file.

-vm
<path to your java location>

example:

-vm
c://localsdk/java70/bin/java

[ Assuming that you have installed your standalone java in c://localsdk/java70).

The catch here is that, if your path has 'space' as part of the path name (example: C://Program Names/DirectoryName/bin etc), then it is better to include that with in double quotes.

After having done this, I was getting error saying -vm is not a recognized option and that JVM crashed. Looking around, I found that the error wasn't from eclipse itself but from JVM. Normally eclipse.ini file would include many other arguments. The -vm option MUST BE included BEFORE -vmargs options. Otherwise everything that is following -vmargs would be passed to JVM as command line options while running the Eclipse. So where you add -vm matters. Always add your -vm option before -vmargs options.

--
Paul Arockiam


No comments:

Post a Comment