Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MacOSX Snow Leopard and Eclipse: Error starting Eclipse (No Java virtual machine....)

This is so frustrating.

I did no update of java nor eclipse and suddenly I can't open eclipse. I even didn't install any other programs. Here is the error:

error

I've tried everything. I updated to new java version and no luck on that: java versions

I downloaded the newest eclipse and had no luck.

Then I updated eclipse's Info.plist file:

Added: <string>-vm</string><string>/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Commands/java</string>

Info.plist

From terminal:

terminal

What else could I do?

EDIT:

Path variable:

PATH

EDIT 2: Strange behavior. If I go right click on eclipse.app and navigate through: Contents/MacOS/eclipse and double click it then a terminal opens and eclipse starts: eclipseFromTermina

Why is that so. I want to run eclipse directly from eclipse.app, not through Contents/.....

EDIT 3:

I see that someone had the same exact problem as me but I haven' find the solution yet: http://www.eclipse.org/forums/index.php/t/107226/

like image 295
vale4674 Avatar asked Jul 11 '11 13:07

vale4674


People also ask

How do you solve error could not create the Java Virtual Machine error a fatal exception has occurred program will exit?

At 'java Properties" window select the Compatibility tab and below the Settings pane, check the box Run this program as an administrator. Then click Apply and OK. 5. Finally, start the program that cannot run because of the "Could Not Create the Java Virtual Machine" error and see if the problem persists.


1 Answers

OK, after a few days of struggling and with no luck on this thread and Eclipse forums THREAD I started a bounty for this question and had no correct answer.

I found a solution to this problem (this stack).

ANSWER:

You need to edit the Eclipse.app/Contents/Info.plist file and add two lines in it:

enter image description here

Nowhere stated that this lines had to go in Eclipse array but just somewhere up as key-string.

If you don't have Xcode, edit that file with textedit:

    <key>Eclipse</key>
<array>
    <string>-vm</string>
    <string>/System/Library/Frameworks/JavaVM.framework/Home/bin/java</string>
    <string>-keyring</string>
    <string>~/.eclipse_keyring</string>
    <string>-showlocation</string>
</array>
like image 79
vale4674 Avatar answered Oct 06 '22 09:10

vale4674