MacOSX Snow Leopard and Eclipse: error starting Eclipse (no Java virtual machine ...)

This is so frustrating.

I did not update java and eclipse, and suddenly I can not open eclipse. I did not even install any other programs. Here is the error:

error

I have tried everything. I upgraded to a new version of java and no luck: java versions

I uploaded the latest eclipse and no luck.

Then I updated the eclipse 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 right-click on eclipse.app and navigate to: Contents / MacOS / eclipse and double-click on it, then the terminal will open and the eclipse will begin: eclipseFromTermina

Why is this so. I want to run eclipse directly from eclipse.app and not through Content / .....

EDIT 3:

I see that someone had the same problem as mine, but I have not found a solution: http://www.eclipse.org/forums/index.php/t/107226/

+6
source share
7 answers

OK, after several days of struggle and no luck on this topic and the Eclipse THREAD forums I started generosity for this question and did not have the 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 to it:

enter image description here

Nowhere is it said that these lines were supposed to go in an Eclipse array, but only somewhere as a key string.

If you do not have Xcode, edit this 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> 
+14
source

Try moving the workspace and removing configs ( rm -rf ~/.eclipse ). Sometimes Eclipse messes up its env and needs to be reset.

+3
source

Editing the plist file is not the recommended way to install the JVM. See http://wiki.eclipse.org/FAQ_How_do_I_run_Eclipse%3F#Find_the_JVM and it points to http://wiki.eclipse.org/Eclipse.ini#Specifying_the_JVM

Basically inside Eclipse.app/MacOS/eclipse.ini you should specify command line arguments that are passed to eclipse by default. The provided array of arguments is also used, but this is not how the Eclipse docs themselves recommend setting the arguments (and perhaps this could lead to erasure when Eclipse is updated again).

You want to remove the vm entry from this array in plist and instead add the following to eclipse.ini: "-vmargs":

 -vm /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/bin/java 
+2
source

try adding this to your ~/.profile

 export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/ export PATH=$JAVA_HOME/bin:$PATH 
+1
source

You need to create the ~/.MacOSX/environment.plist file and add JAVA_HOME => /Library/Java/Home . If you have Xcode installed, use it to add an entry. Otherwise, use a text editor:

 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>JAVA_HOME</key> <string>/Library/Java/Home</string> </dict> </plist> 

After that, restart MaxOS or log out / log in.

See http://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/EnvironmentVars.html for details.

Cheers, Max

+1
source

I ran into the same problem but simple

 chmod +x Contents/MacOS/eclipse 

in the contents of the package, did the trick.

0
source

I fixed this with a 2-step solution:

* 1. Set JAVA_HOME correctly: *

Find out the location of the Java JDK:

 /usr/libexec/java_home 

Create a ~ / .bash_profile file if necessary:

 touch ~/.bash_profile 

Edit the .bash_profile file with TextEdit and add the following lines (change the paths if necessary):

export JAVA_HOME = / Library / Java / JavaVirtualMachines / jdk1.7.0_51.jdk / Contents / Home / export PATH = $ JAVA_HOME / bin: $ PATH

2. Set an alias to execute:

At the eclipse installation location, run:

 chmod +x ./eclipse 

Now, to activate Eclipse, open Finder, go to the eclipse installation directory and double-click the alias file (named eclipse, but without the eclipse icon).

0
source

Source: https://habr.com/ru/post/892488/


All Articles