Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
522 views
in Technique[技术] by (71.8m points)

macos - How to brew install java?

I'd like to setup java on a new OS X machine, and prefer to use brew for OS X package management. How can I install latest java using brew?

question from:https://stackoverflow.com/questions/65601196/how-to-brew-install-java

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Turns out java has been moved into brew core recently, so the correct command as of January 2021 is:

brew install java

Don't be like me and follow old instructions to install from cask, it will not work. You will get an error message from brew like this:

% brew install --cask java
Error: Cask 'java' is unavailable: No Cask with this name exists.

You may also see this:

% brew cask install java
Error: Calling brew cask install is disabled! Use brew install [--cask] instead.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...