9

I have a problem run Apache Directory Studio On Apple silicon MBP M1 Max.

Error:

2021-12-03 12:42:07.497 ApacheDirectoryStudio[5675:42763] Error loading /Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/MacOS/libjli.dylib: 
 dlopen(/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/MacOS/libjli.dylib, 0x0109): 
 tried: '/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/MacOS/libjli.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')),
  '/usr/lib/libjli.dylib' (no such file)

Looks like Homebrew has ApacheDirectoryStudio x86_64 version, but Java is arm64.

Please help.

Saikat
  • 14,222
  • 20
  • 104
  • 125
Andrii Petrenko
  • 163
  • 3
  • 6

7 Answers7

34

I was able to run ApacheDirectoryStudio by installing Java for x86_64. Rosetta 2 is required to make this work on the aarch64 (Apple M1) architecture.

To install the x86_64 version of the Java JDK via Homebrew, following command can be used:

arch -x86_64 brew install oracle-jdk

Versions used:

  • ApacheDirectoryStudio: 2.0.0.v20210717-M17
  • Oracle JDK: 17.0.2
Martin M.
  • 707
  • 7
  • 16
  • 1
    So far, this seems to have worked great. You can also install ApacheDirectoryStudio using Homebrew with `brew install apache-directory-studio`. – q0rban Feb 15 '22 at 17:59
  • 1
    Nice one! Install the oracle-jdk and then edit the Info.plist as per https://stackoverflow.com/a/33477302. This is the only solution that worked for me. – moritz.vieli Apr 22 '22 at 19:45
  • I tried this method and also modified info.plist as suggested by moritz.vieli but it's not working for me. I'm getting this error "The JVM shared library "/opt/homebrew/Cellar/openjdk/19/libexec/openjdk.jdk/Contents/Home/bin/../lib/server/libjvm.dylib" does not contain the JNI_CreateJavaVM symbol." Any ideas? – Alex Nov 02 '22 at 13:05
  • Worked fine on Mac M1. Thanks! – Peter Edwards Jan 10 '23 at 15:40
5

There doesn't seem to be a current version which works. However, you can get a working version by installing the new M1 version of Eclipse available here:

https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/2021-12/R/eclipse-java-2021-12-R-macosx-cocoa-aarch64.dmg]

Then, at the bottom of the Apache Directory Studio download page is a link with instructions on how to load the directory studio plugin into Eclipse. This works fine. (I am using Java 17, but it should work with any java version from 11 upwards as far as I can see).

Philip
  • 71
  • 3
1

The latest version of Apache Directory Studio needs Java 11 at a minimum. But even that won't help you on M1, Eclipse won't run, with the old problem of "missing symbol" - which is actually there.

Eclipse has had this problem on and off for years, on all platforms.

The architecture of Java doesn't matter. The Intel version runs fine with Rosetta2. Remember, Java is architecture independent. It the JVM runs, the java application runs.

You may want to encourage them by commenting on my bug report:

https://issues.apache.org/jira/projects/DIRSTUDIO/issues/DIRSTUDIO-1293

There is an RC release of Eclipse for the M1. No clue how long it will take the Apache Directory Studio team to pick it up.

Philip
  • 71
  • 3
  • Thank you for the answer. I've install Rosetta2 on my Mac, but I see no "Open using Rosetta" on "Apache Directory Studio" info. Do you know how to force app to use Rosetta2? – Andrii Petrenko Dec 05 '21 at 18:26
1

You can modify the content of Info.plist.

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

This file contains the following commented content:

      <!-- 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>/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Commands/java</string>
            <string>-vm</string><string>/Library/Java/JavaVirtualMachines/1.8.0.jdk/Contents/Home/bin/java</string>
        -->

Uncomment this line with the path to your installed JDK.

0

You can find org.eclipse..cocoa.macosx.x86_64. in

/Applications/ApacheDirectoryStudio.app/Contents/Eclipse/plugins.

They are preventing boot on M1 Mac.

You can use Apache Directory Studio as an application on Eclipse. See https://directory.apache.org/studio/installation-in-eclipse.html

Masatoshi
  • 197
  • 1
  • 6
0

Martin M.'s solution to install the x86_64 version of a jdk worked for me. Rather than using the oracle-jdk (because that is now licensed software) I used temurin-11. Then following moritz.vieli's comment to modify the Info.plist got things working! To find which path to put into the Info.plist file, run the following command to see which jdk's are installed on your mac:

/usr/libexec/java_home -V  (and append /bin/java to the path)

This info is found on the Apache Directory Studio website under the FAQ section.

brandg
  • 11
  • 2
-3

Somehow version 2.0.0.v20200411-M15 ran out of the box on my M1.

fardin
  • 1,399
  • 4
  • 16
  • 27