一、安装GIT和IDE
1、既然是小白,那么就直接XCODE吧,Git等直接都装好了,可惜要耗费大概10GB空间
2、剩下的IDEA和MyEclipse那就看大家心情了
二、本机搭建JAVA环境:
2.进入root帐号:sudo -s
3、vim ~/.bash_profile
最后一行增加:
JAVA_HOME=”/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/”
CLASS_PATH=”$JAVA_HOME/lib”
PATH=”.;$PATH:$JAVA_HOME/bin”
4、java -v验证执行
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
二、本机安装Meven:
2.解压并拷贝到/Library/Java/目录下
3.vim ~/.bash_profile
最后一行增加:
M2_HOME=/Library/Java/apache-maven-3.3.9
export PATH=$PATH:$M2_HOME/bin
4.mvn -version 检查配置正确性
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T00:41:47+08:00)
Maven home: /Library/Java/apache-maven-3.3.9
Java version: 1.8.0_121, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "mac os x", version: "10.12.3", arch: "x86_64", family: "mac"
三、执行代码:
进入代码目录中,包含pom.xml文件的目录下,执行:
mvn spring-boot:run
查看LOG中,包含“”Tomcat started on port(s): 8050 (http)“,就可以在浏览器中访问:http://localhost:8050/