20
votes

Eclipse 4.4.0 on Mac OSX 10.9, JVM 8 gives an alert when I try to run it:

"The JVM shared library "/Library/Java/JavaVirtualMachine/jdk1.8.0_20.jdk/Contents/Home/bin/.../jre/lib/server/libjvm.dylib" does not contain the JNI_CreateJavaVM symbol"

The application does not start.

I edited the Info.plist per Shan's instructions of 8/25, but I still get the same error.

I've also downloaded & installed Java from Apple's web site, but I still get the same error.

thanks for the help.

7
Make sure you are using the 64 bit version of Mac Eclipse - greg-449
That worked, thanks Greg - Ray Lang
For me installing Eclipse Mars fixed it for me. I don't think it was anything to do with the 32 or 64bits since my Activity Monitor (yes I'm on OSX) didn't say x32 against Eclipse. +1 for @greg-449 however. - Sufian
You can find a detailed explanation here stackoverflow.com/questions/24589932/… - Oguz

7 Answers

10
votes

If you are installing eclipse with the Eclipse installer, this can happen when the installer is not pointed to the correct jvm location.
You can correct it as follows.

1. Right click the installer file and select 'show package contents'
2. Go to Contents and open Info.plist
3. At the bottom of this file, you'll see a commented section with the tag <string>-vm</string> with some paths. You can set the correct JAVA_HOME path there and uncomment that section. (running echo $JAVA_HOME in console will get you the current setting)

1
votes

There are several important details that I found during the latest Eclipse installation on Mac OS

  • Info.plist is really locked. I unlocked it using a command line and then "chmod 666 Info.plist".
  • The versions of the vm string in the Info.plist are specific for the JDK. I was not able to make this work with JDK 13. So, I used my version of Java 8:

/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/bin/java

  • appeared important: JAVA_HOME should exactly correspond to what you have in Info.plist

To unlock Info.plist you need to extract Eclipse Installer.app from the dmg file. Then the following commands from the directory containing Eclipse Installer.app :

cd "Eclipse Installer.app"/Contents
chmod 666 Info.plist 
1
votes

I got different errors with different Java versions (all varieties of java 11).

For me, it started with-

“jdk-11.0.1.jdk” cannot be opened because the developer cannot be verified.

I tried to make this work and once I got past this error, I hit-

The JVM shared library does not contain the JNI_CreateJavaVM symbol.

Then I tried with another java 11, and ran into-

failed to create java virtual machine

Here're the different versions I have-

/usr/libexec/java_home -V

Matching Java Virtual Machines (4):

11.0.5, x86_64:   "AdoptOpenJDK 11"   /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home
11.0.4, x86_64:   "OpenJDK 11.0.4"    /Library/Java/JavaVirtualMachines/jdk-11.0.4+11/Contents/Home
11.0.1, x86_64:   "OpenJDK 11.0.1"    /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home
1.8.0_161, x86_64:    "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home

I had another variant of java 11 too that you don't see in the list above as I removed it.

What finally worked for me- OpenJDK 11.0.4.

11.0.4, x86_64:   "OpenJDK 11.0.4"    /Library/Java/JavaVirtualMachines/jdk-11.0.4+11/Contents/Home

I also re-installed Eclipse (2019-12 vers) using Eclipse Installer on Mac. That's how I had installed it earlier too, but it hadn't worked with other java 11's. Note-

0
votes

In my case, I'd had several jdk's installed as shown when running the command:

/usr/libexec/java_home -V

and the installer was complaining about the Java JDK 11 not having what it needed. Since I'd backed off using 11 in favor of 8 I was okay removing this JDK from my system using the command:

cd /Library/Java/JavaVirtualMachines
sudo rm -fr jdk-11.0.1.jdk

this made my jdk1.8.0_221.jdk the most current jdk and the installer worked fine.

You could probably mv the jdk-11.0.1.jdk to another location to get Eclipse installed using a different jdk version and then move it back.

0
votes

I have run into this problem and ended up switching to a newer build of openjdk 13.0.2 by pointing eclipse to it directly in info.plist to resolve the issue. It did not work with build build 12.0.2+8. The build 12.0.2+10 addressed the issue.

/Library/Java/JavaVirtualMachines/jdk-12.0.2.openjdk/Contents/Home/bin
mychine1:bin$ ./java -version
openjdk version "12.0.2" 2019-07-16
OpenJDK Runtime Environment (build 12.0.2+10)
OpenJDK 64-Bit Server VM (build 12.0.2+10, mixed mode, sharing)
0
votes

I encountered this issue while attempting to install Eclipse IDE for Eclipse Committers, version 2021-03 (4.19.0) on macOS 11.2.3 on my MacBook Air (M1, 2020). I was using the Azul arm64 JDK. This issue was solved by installing the OpenJDK x64 and updating the following file:

Eclipse.app/Contents/Info.plist

to point to OpenJDK as per the instructions in Rajeev Sampath's answer. I'm assuming the issue was from using an arm64 compiled JDK with Eclipse which currently only for x64.

0
votes

In my case, i have java 11 only installed, to solve the problem i have installed java 8 and set the java 8 in the JAVA_HOME then it started workin.