eclipse not working - No java virtual machine was found

Gaurav Shah picture Gaurav Shah · May 5, 2011 · Viewed 37.5k times · Source

I installed eclipse and netbeans on mac osx 10.6 I installed android sdk and everything was working perfectly.

Now I installed mac ports and installed ImageMagick using macports

Now after restarting the system neither netbeans work nor eclipse.

Net beans closes without any error. and eclipse give following error :

A JDK or JRE must be installed in order to run eclipse No java virtual machine is found after searching the following location: /Users....../eclipse.app ContentsMacOS/jre/bin/java java in you current PATH

I thought the problem might be with the path.

So I tried running java and javac from terminal. But these two commands run properly.

note: I don't have javaw (I am not sure whether we have this file in mac or not.

Can I know what can be the problem and how can I fix it ?

Answer

dedulya picture dedulya · Nov 1, 2011

In the Eclipse.app/Contents/MacOS/eclipse.ini file put

-vm 
/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home/bin/java

right before

 -vmargs

should help, I hope ... I hope