HomebrewI don’t want to do more introductions, developers certainly know. Here is a recommended article:
- Fly your Mac with Homebrew
- What do I use on the Mac
Since Oracle took over the JDK, updates have become faster and previous “older versions” are not easy to download. For some time recently, Oracle has been in a state of uneasy. so the installation method has been changed. The previous method is no longer usable.
JDK8 ~ JDK12, OpenJDK and AdoptOpenJDK
These are some of the most popular versions of the JDK and are still in use by most companies. However, it is not easy to use Homebrew to install JDK8. AdoptOpenJDK is recommended.
AdoptOpenJDK is a free, completely unbranded version of OpenJDK based on the GPL open Source agreement (+Classpath Extension). It provides community OpenJDK binaries as free software that companies can safely use. Unlike versions built by Oracle’s OpenJDK, these versions provide longer support, like Java 11, with a free long Term support (LTS) plan of at least 4 years.
The largest number of JDK versions can be installed with AdoptOpenJDK.
brew cask install AdoptOpenJDK/openjdk/adoptopenjdk8
brew cask install AdoptOpenJDK/openjdk/adoptopenjdk9
brew cask install AdoptOpenJDK/openjdk/adoptopenjdk10
brew cask install AdoptOpenJDK/openjdk/adoptopenjdk11
brew cask install AdoptOpenJDK/openjdk/adoptopenjdk12
brew cask install AdoptOpenJDK/openjdk/adoptopenjdk
Copy the code
JDK12, JDK13 and OracleJDK
If you want to install the latest version of the JDK on your computer, Oracle is probably the most popular choice. The latest version of the Oracle JDK is also available in two versions: the OpenJDK provided by Oracle and the commercial Version of the Oracle JDK. But note that the Oracle JDK is not “better” than OpenJDK, and you need to be rational.
In May 2019, this command will install OpenJDK12 brew cask provided by Oracle This command will install the OpenJDK11 brew cask install java11 provided by OracleCopy the code
JDK7 and Zulu
Zulu is a free version of OpenJDK. In addition to commercial paid support, Azul also provides free community support for Zulu.
We can install OpenJDK7 by installing Zulu7.
Brew Cask install homebrew/cask-versions/zulu7 brew cask versions of zulu8 zulu11 and the latest version of Zulu7 can be installed using brew Cask versions install homebrew/cask-versions/zulu8 brew cask install homebrew/cask-versions/zulu11 brew cask install homebrew/cask-versions/zuluCopy the code
Fourth, the JDK6 has
It is estimated that many enterprises do not need it now, so put it on the left. JDK6 is primarily provided by Apple itself.
brew cask install homebrew/cask-versions/java6
Copy the code
Be patient with problems. If you haven’t solved them, you haven’t spent enough time
- The first night I got my coveted MacBook Pro (13-inch, 2019, Four Thunderbolt 3 Ports), I took it apart for more than half an hour, taking photos as I took it apart, washing my hands 😂 as I took it apart. Before that, I used to “pick up macOS” in advance in my spare time.
- Dimly still remember the first day of their own drum that group installed, motherboard: Asus, CPU: Intel Pentium E5400, hard disk 512G HDD, Kingston 2G, now is really very card, although installed the latest version of Windows V1903 professional version. But as my first computer, a lot of things are learned on it, thanks to the next dad will it as the grade of the first award computer to me.
- On the evening of September 21st, EMMM is the night, and you should have the same feeling as me. Some stations are very slow at night, such as
GitHub
But I must deploy my development environment as soon as possible. After all, WHEN I was in sophomore year, I was about to become a professional operation and maintenance professional. Whenever my classmates had problems with their computers, I was the one to be consulted. Install Git, JDK and Maven first. - Git is simple. Although the macOS does not come with Git, the Command Line Tools installed before Homebrew installation include Git, GCC and other Tools, which are very convenient and relatively fast (if you change the source of Homebrew).
- It took a lot of work to get the JDK installed, and it was done at 6:10 the next morning, because accessing sites like GitHub in the morning is actually much faster than in the afternoon. The result was this article.
- Maven can be installed on Homebrew, or unzip the package from Maven’s official website, and then use it. Many people may want to configure Mavne environment variables, but I personally think it is not necessary. IDEA is now the mainstream IDE tool for Java development. The terminal can be configured by itself. The combination of ZSH and OH my ZSH is absolutely perfect. I used “two Mavens”, one for the company (the company has its own Maven repository) and the other for myself (ali Cloud image configuration), switching between different mavens in the same IDEA
settings.xml
The main reason is that IDEA is really smart, and the intelligence is configured separately for each project. Multiple projects can completely configure different Maven, and the company’s project and its own project can switch at will, and Maven will also change, which is very convenient. MVN command can not be used without configuring Maven environment, I would like to say: IDEA can still execute your handmvn -U clean package -Dmaven.test.skip=true
, so I do not recommend configuring Maven’s environment variables. With multiple Maven because I think we also do not understand, if the company project in the source of a package or rewrite a method, and your own project use the same package, in which case error-prone, use Maven more or less likely to encounter Maven has some bugs, the iteration the N version there is still a Bug, Maybe this is a flaw in the unified management of packages. If you haven’t done this yet, your project is stable or emmmm… You don’t learn things on your own.