50

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.

Ray Lang
  • 501
  • 1
  • 4
  • 5
  • 1
    Make sure you are using the 64 bit version of Mac Eclipse – greg-449 Sep 10 '14 at 07:08
  • 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 Nov 05 '14 at 11:54
  • You can find a detailed explanation here https://stackoverflow.com/questions/24589932/mac-os-jdk1-7-and-1-8-does-not-contain-the-jni-createjavavm-symbol/25869530 – Oguz Dec 11 '19 at 08:29

16 Answers16

27

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)

Rajeev Sampath
  • 2,739
  • 1
  • 16
  • 19
13

If someone is struggling with this in 2022, the following download helped me:

https://adoptium.net/temurin/releases/?version=16

And -vm in ***.app/Contents/Info.plist should be

<string>-vm</string><string>/Library/Java/JavaVirtualMachines/temurin-16.jdk/Contents/Home/bin/java</string>

I'm on MacOS Monterey 12.5.1, Apple M1 Pro, my problem was with Apache Directory Studio - when trying to run it I was getting:

the jvm shared library does not contain JNI_CreateJavaVM symbol
n1k1ch
  • 2,594
  • 3
  • 31
  • 35
  • Yes, this solved my Directory Studio issue on Apple M1 as well, thank you! – wytten Nov 21 '22 at 19:38
  • 1
    Already 2023 and I also had to install this old temurin version 16 to get Apache Directory Studio to work (didn't work with the latest version 19 and also not with the latest LTS release version 17). Then again Directory Studio wasn't updated since July 2021 and is probably therefore not compatible with newer java versions. – cstoll Jan 23 '23 at 17:38
  • 1
    I had to use version 11 of the JDK for Apache Directory Studio, it wasn't working with either version 17 or 16. – phwoelfel May 17 '23 at 09:48
  • 1
    For Apache Directory Studio, downloading the **x64 (Intel)** version of JRE 17 fixes the problem. Apache Directory Studio hasn't been updated for Apple Silicon yet, and thus needs an x64 Intel JVM for its native libraries to work. – praseodym Aug 12 '23 at 09:48
  • In 2023 and onwards, for those that are using Apple MacBook M1 chips, please make sure to download the corresponding ARM based software instead of regular ones. – Fisher Coder Aug 29 '23 at 00:46
9

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.

aaroncarsonart
  • 1,054
  • 11
  • 27
4

For anyone who, like me, needs to know exactly where to add this information, here it goes. First of all, understand where java is - in my case it is something like this (I use asdf but never mind that):

~$ asdf where java
/Users/your.username/.asdf/installs/java/liberica-17.0.2+9

Therefore, the string that MAT needs to know is "/Users/your.username/.asdf/installs/java/liberica-17.0.2+9/bin/java". This is the string I add to MAT's .plist file:

    ...
    <key>Eclipse</key>
        
    <array>
                
      <string>-keyring</string>
      <string>~/.eclipse_keyring</string>

      <string>-vm</string>
      <string>/Users/your.username/.asdf/installs/java/liberica-17.0.2+9/bin/java</string>              
    </array>
    
    <key>CFBundleDisplayName</key>
    <string>MemoryAnalyzer</string>

  </dict>

</plist>

For contrast, these were the original contents of the file:

    ...
    <key>Eclipse</key>
            
    <array>
                
      <string>-keyring</string>
      <string>~/.eclipse_keyring</string>
            
    </array>
    
    <key>CFBundleDisplayName</key>
    <string>MemoryAnalyzer</string>
  </dict>
  
</plist>

Just for information, I am using a Mac with M1 architecture.

Milad
  • 836
  • 7
  • 13
  • 1
    This helped, awesome, I was trying to open Eclipse Memory Analyzer, So I need to update `code mat.app/Contents/Info.plist` – reddy nishanth Jul 26 '23 at 03:57
2

I just downloaded the Intel based Java instead of ARM x64 and it worked. I think the problem is that Eclipse is not running natively so it needs a Intel based Java version

1

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 
Alex
  • 7,007
  • 18
  • 69
  • 114
  • Could you specify how you unlocked it? I get 'permission denied' alerts when I try to do it. – Cheetaiean Dec 21 '19 at 20:26
  • 1
    see the explanation in the answer – Alex Dec 21 '19 at 20:33
  • 2
    So I made the necessary changes ( -vm/Library/Java/JavaVirtualMachines/jdk-13.0.1.jdk/Contents/Home/bin/java ) outside of a comment, and now when I try to open the Installer app it says it's "damaged and can't be opened". Could this be bc I dragged the app out of the dmg onto the Desktop? Or the fact that the .plist was tampered with... – Cheetaiean Dec 21 '19 at 21:07
  • Not sure, I did not have this problem. I am working with the package I downloaded – Alex Dec 22 '19 at 01:46
  • Ok, it was indeed an actual bug in the installer application. the bug has now been fixed – Cheetaiean Dec 23 '19 at 14:29
1

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

This happened to me running a x86 version of Eclipse on an M1 (arm64) Mac with an arm64 version of the JDK.

Once changing to the proper arm64 version of Eclipse the problem was solved.

david
  • 662
  • 5
  • 8
0

I got the same error on macOS Ventura 13.4.1 on macbook M1. Following combination has resolved the issue.

Apache Directory version : ApacheDirectoryStudio-2.0.0.v20210717-M17 Link to download

Java Version : jdk-17.0.8+7 Link to Download

How to use the specific version of java

Update the Info.plist File Location :

/Applications/ApacheDirectoryStudio.app/Contents/Info.plist

    <array>
            
  <!-- to use a specific Java version (instead of the platform's default) uncomment one of the following options,
                or add a VM found via $/usr/libexec/java_home -V -->
  <string>-vm</string><string>/Users/XXXXXXXX/dev/app/jdk-17.0.8+7/Contents/Home/bin/java</string>
  <string>-keyring</string>
  <string>~/.eclipse_keyring</string>
        
</array>
Kushan Menake
  • 69
  • 1
  • 6
-1

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.

wnm3
  • 381
  • 3
  • 17
-1

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)
U13-Forward
  • 69,221
  • 14
  • 89
  • 114
TomaszZ.
  • 9
  • 1
-1

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.

Chandra
  • 1,249
  • 1
  • 12
  • 15
-1

Try replacing libjli.dylib with openjdk11.dylib. Works like a charm!

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Oct 18 '21 at 11:28
-1

I have installed eclipse through Homebrew after the issue. Changing the info.plist was causing file corrupted error. Just use the script and that‘s it: https://formulae.brew.sh/cask/eclipse-java

Discalimer: I have also installed Temurin-17.0.1 using brew.

Fay007
  • 2,707
  • 3
  • 28
  • 58
-1

The solution that worked for me is to open the app from a shell instead of double clicking on it. run open /Applications/<name> in the shell. Configuration: Apple m1 open jdk 18 eclipse for arm

Amir Baron
  • 101
  • 6
-1

If somebody has the same problem with a recent version of Eclipse (2021 and above), then the problem is that your Eclipse application is x86 and you have a JVM that is ARM (Apple Silicon).

To solve the issue, in my case, I downloaded an x86 version of Java 11, and then I edited the info.plist file to point at that x86 (Intel) JVM.

So, in my case I downloaded https://adoptium.net/temurin/releases?version=11

Download x86 (Intel) version of JDK

And then I added the following key to the info.plist

<string>-vm</string><string>/Library/Java/JavaVirtualMachines/temurin-11.jdk/Contents/Home/bin/java</string>

Edit info.plist by setting the location of the Intel JDK

psuzzi
  • 2,187
  • 1
  • 17
  • 21