尝试在Mac上使用自制程序安装java11。我得到以下错误:
版本:
- MacOS 12.5.1 家酿3.6.15
$ brew install java11
Running `brew update --auto-update`...
==> Fetching openjdk@11
==> Downloading https://ghcr.io/v2/homebrew/core/openjdk/11/manifests/11.0.17
Already downloaded: /Users/nhegde/Library/Caches/Homebrew/downloads/dbe2b576c95bab6391300376bf2b11c3cd7cba975a7008a831e6c8b68b1ee70e--openjdk@11-11.0.17.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/openjdk/11/blobs/sha256:a7dd4515b5a6c3215390a6fcf07a8809b88cca277ab1c3db190bf644eebce6fe
Already downloaded: /Users/nhegde/Library/Caches/Homebrew/downloads/a4080d6b30cfa6067ff421dfb06d476977e3f7e65ee73c7daf0f9ba03f0d2381--openjdk@11--11.0.17.monterey.bottle.tar.gz
==> Pouring openjdk@11--11.0.17.monterey.bottle.tar.gz
Error: Directory not empty @ dir_s_rmdir - /private/tmp/d20221212-9750-tiwlq
我检查了目录,它确实存在。
$ ls -l /private/tmp/d20221212-9750-tiwlq/
total 0
drwxrwxrwx 3 myuser wheel 96 Dec 12 13:39 openjdk@11/
任何帮助都非常感谢!
您可以简单地尝试手动删除有问题的目录:
sudo rm -rf /private/tmp/d20221212-9750-tiwlq/
另一个选择是从Eclipse Temurin中安装JDK 11:
brew tap homebrew/cask-versions
brew install --cask temurin11
在我的情况下(macos Ventura 13.5, Homebrew 4.1.5-55-g3cd7290),我只是重新启动系统,问题自行修复(源代码)。任何其他尝试(brew doctor
,brew cleanup
,卸载和重新安装桶等)都不成功。