1.JDK安装配置
1.下载JDK(jdk-8u144-macosx-x64.dmg)并安装
2.配置Java环境变量
查看jdk安装位置
/usr/libexec/java_home-v
打开环境变量行尾键入
vi /etc/profile
JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home"
export JAVA_HOME
CLASS_PATH="$JAVA_HOME/lib"
PATH="".$PATH:$JAVA_HOME/bin"
载入环境变量
source /etc/profile
查看Java版本号
java -version
返回:
java version"1.8.0_144"Java(TM)SE Runtime Environment (build1.8.0_144-b01)JavaHotSpot(TM)64-Bit Server VM (build25.144-b01, mixed mode)
2.Tomcat安装配置
1.下载安装Tomcat apache-tomcat-7.0.81.tar.gz
解压,文件夹改名为tomcat移动该文件夹,至你习惯的目录,比如/Library执行/Library/tomcat/bin下的startup.sh打开http://localhost:8080 查看是否tomcat已经启动解决文件权限问题:sudo chmod755/Library/tomcat/bin/*.sh
2.配置tomcat
打开并尾部键入设置管理账户(admin/admin) /Library/tomcat/conf/tomcat-users.xml
3.Maven安装配置
下载Maven, 并解压到/Library/Maven目录
打开Terminal,设置Maven classpath
打开环境变量
vi /etc/profile
结尾输入环境变量
export M2_HOME="/Library/Maven"exportPATH="$PATH:$M2_HOME/bin"
载入环境变量
source /etc/profile
检查Maven安装状态
输入mvn-v查看Maven是否安装成功
返回:
Apache Maven3.5.0(ff8f5e7444045639af65f6095c62210b5713f426;2017-04-04T03:39:06+08:00)Mavenhome:/Library/MavenJavaversion:1.8.0_144,vendor:Oracle CorporationJavahome:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jreDefaultlocale:zh_CN, platformencoding:UTF-8OSname:"mac os x",version:"10.12.5",arch:"x86_64",family:"mac"