M1 Pro芯片MacBook Pro安装JMeter报错问题及解决方案咨询
M1 Pro芯片Mac安装JMeter报错问题解答
报错现象
在搭载M1 Pro芯片、macOS Monterey 12.5系统的MacBook Pro上执行brew install jmeter时,出现以下报错:
Follow the instructions here: https://github.com/Homebrew/homebrew-cask#reporting-bugs Warning: Unexpected method 'on_arm' called on Cask zulufx. Follow the instructions here: https://github.com/Homebrew/homebrew-cask#reporting-bugs Warning: Unexpected method 'arch' called on Cask zulufx. Follow the instructions here: https://github.com/Homebrew/homebrew-cask#reporting-bugs Error: openjdk: undefined method `on_arm' for #<Resource:0x0000000137b0b020>
报错原因
- Homebrew的Cask配置中,
zulufx组件使用了已废弃的on_arm和arch方法,触发警告。 - JMeter依赖的OpenJDK安装流程中,同样调用了已被移除的
on_arm方法——该方法是旧版本Homebrew用于ARM架构适配的API,新版本已不再支持,直接导致安装失败。
解决办法
- 更新Homebrew到最新版本,修复API兼容问题:
brew update && brew upgrade - 清理Homebrew缓存并修复潜在依赖损坏:
brew cleanup && brew doctor - 先手动安装兼容ARM架构的OpenJDK(JMeter推荐使用Java 8/11/17版本):
安装完成后配置Java环境变量,将以下内容添加到brew install openjdk@17~/.zshrc或~/.bash_profile:
执行export PATH="/opt/homebrew/opt/openjdk@17/bin:$PATH" export JAVA_HOME=$(brew --prefix openjdk@17)source ~/.zshrc使配置生效。 - 重新安装JMeter:
brew install jmeter - 如果仍存在
zulufx相关警告,先卸载该组件再重试:brew uninstall --cask zulufx
M1 Pro芯片Mac的JMeter兼容性
M1 Pro芯片的MacBook Pro完全可以安装并正常运行JMeter。官方JMeter已支持ARM架构,无论是通过Homebrew安装,还是直接从官网下载压缩包解压使用,只要配置好兼容的Java环境,就能正常开展性能测试工作。
内容的提问来源于stack exchange,提问作者Dolphin
相关产品推荐
相关产品推荐

