macos arm64安装Apache Directory Studio

530 阅读1分钟

安装JDK

# 安装jdk11
$ brew install --cask adoptopenjdk/openjdk/adoptopenjdk11

==> **Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/down**

==> **Downloading from https://objects.githubusercontent.com/github-production-rel**

######################################################################### 100.0%

==> **Installing Cask** **adoptopenjdk11**

==> **Running installer for adoptopenjdk11; your password may be necessary.**

Package installers may write to any location; options such as `--appdir` are ignored.

installer: Package name is AdoptOpenJDK

installer: Installing at base path /

installer: The install was successful.

package-id: net.adoptopenjdk.11.jdk

version: 11.0.11+9

volume: /

location: 

install-time: 1686020205

🍺  adoptopenjdk11 was successfully installed!

# 查看jdk目录
$ /usr/libexec/java_home -V

Matching Java Virtual Machines (2):

    17.0.7 (arm64) "Oracle Corporation" - "Java SE 17.0.7" /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home

    11.0.11 (x86_64) "AdoptOpenJDK" - "AdoptOpenJDK 11" /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home

/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home

安装 Apache Directory Studio

直接下载dmg文件安装

下载地址: directory.apache.org/studio/ image.png

image.png

image.png

brew 方式安装

brew install --cask apache-directory-studio

指定java路径

找到并修改Info.plist文件,使其指向AdoptOpenJDK 11的路径。该文件通常在Apache Directory Studio的应用程序文件夹内,您可能需要右键单击应用程序并选择“显示包内容”来查看它。

image.png

或直接打开此文件:/Applications/ApacheDirectoryStudio.app/Contents/Info.plist

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<plist version="1.0">
  
  <dict>
    	
    <key>CFBundleExecutable</key>
    		
    <string>ApacheDirectoryStudio</string>
    	
    <key>CFBundleGetInfoString</key>
    		
    <string>Eclipse 4.18 for Mac OS X, Copyright IBM Corp. and others 2002, 2020. All rights reserved.</string>
    	
    <key>CFBundleIconFile</key>
    		
    <string>studio.icns</string>
    	
    <key>CFBundleIdentifier</key>
    		
    <string>org.apache.directory.studio.product</string>
    	
    <key>CFBundleInfoDictionaryVersion</key>
    		
    <string>6.0</string>
    	
    <key>CFBundleName</key>
    		
    <string>ApacheDirectoryStudio</string>
    	
    <key>CFBundlePackageType</key>
    		
    <string>APPL</string>
    	
    <key>CFBundleShortVersionString</key>
    		
    <string>2.0.0</string>
    	
    <key>CFBundleSignature</key>
    		
    <string>????</string>
    	
    <key>CFBundleVersion</key>
    		
    <string>2.0.0.v20210717-M17</string>
    	
    <key>NSHighResolutionCapable</key>
    		
    <true/>
    	
    <key>CFBundleDevelopmentRegion</key>
    		
    <string>English</string>
    		
	
    <key>Eclipse</key>
    		
    <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>/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>
			-->
                        
      <!-- 添加下方两行配置,全文只改这 -->
      <string>-vm</string>
      <string>/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home/bin/java</string>
			
      <string>-keyring</string>
      <string>~/.eclipse_keyring</string>
      		
    </array>
    
    <key>CFBundleDisplayName</key>
    <string>ApacheDirectoryStudio</string>
  </dict>
  
</plist>