由于其中一个项目使用的是 Java 1.7,因此我希望该版本能够手动运行 mrunit 测试用例。我在我的机器上安装了 java8,也想要 java7。当我运行 brew cask install java7 时,它会抛出错误消息 - 错误:木桶'java7'不可用:不存在具有此名称的木桶。
由于在博客和 Stackoverflow 中建议使用 brew cask,您能否建议如何安装旧的 java 版本?
echo JAVA_HOME
/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home
brew cask
Homebrew Cask provides a friendly CLI workflow for the administration
of macOS applications distributed as binaries.
Commands:
--cache display the file used to cache the Cask
audit verifies installability of Casks
cat dump raw source of the given Cask to the standard output
create creates the given Cask and opens it in an editor
doctor checks for configuration issues
edit edits the given Cask
fetch downloads remote application files to local cache
home opens the homepage of the given Cask
info displays information about the given Cask
install installs the given Cask
brew cask install java7
Error: Cask 'java7' is unavailable: No Cask with this name exists.
参考资料:http ://davidcai.github.io/blog/posts/install-multiple-jdk-on-mac/