最近新换了电脑,重新配置环境,恰好讲这些基础能力归档一下,欢迎收藏~~
1.jdk
下载地址https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
环境配置JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_212.jdk/Contents/Home
PATH=$JAVA_HOME/bin:$PATH:.
CLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar:.
export JAVA_HOME
export PATH
export CLASSPAT
2.maven安装与配置
1 下载Maven
地址:http://maven.apache.org/download.cgi
下载tar.gz文件,并将其解压到usr/local/maven目录下。
2 配置Maven环境变量
iTem终端打开下面配置文件:
vi ~/.bash_profile
按 i 键进入编辑模式,输入如
export M2_HOME=/usr/local/maven/apache-maven-3.3.3 export PATH=$PATH:$M2_HOME/bin
点击 esc 按钮退出编辑模式,输入 :wq 保存退出。
输入如下命令使配置生效:
source ~/.bash_profile
重新打开一个终端,输入:
mvn -v
3. git 安装
https://git-scm.com/download/mac
Download for macOS
There are several options for installing Git on macOS. Note that any non-source distributions are provided by third parties, and may not be up to date with the latest source release.
Homebrew
Install homebrew if you don't already have it, then:
$ brew install git
Xcode
Apple ships a binary package of Git with Xcode.
Binary installer
Tim Harper provides an installer for Git. The latest version is 2.33.0, which was released 8 days ago, on 2021-08-30.
Building from Source
If you prefer to build from source, you can find tarballs on kernel.org. The latest version is 2.33.0.
Installing git-gui
If you would like to install git-gui and gitk, git's commit GUI and interactive history browser, you can do so using homebrew
$ brew install git-gui