ubuntu安装tomcat和maven

下载tomcat

sudo wget http://apache.mirrors.tds.net/tomcat/tomcat-8/v8.5.38/bin/apache-tomcat-8.5.38.tar.gz
sudo mv apache-tomcat-8.5.38.tar.gz /usr/local/
sudo tar -zxvf apache-tomcat-8.5.38.tar.gz 

##  vim打开tomcat的bin目录下的setclasspath.sh 添加
export JAVA_HOME=/usr/local/src/jdk1.8.0_201 #具体地址具体修改
export JRE_HOME=${JAVA_HOME}/jre


#启动
sudo apache-tomcat-8.5.38/bin/startup.sh

修改tomcat配置

#进入server.xml文件,修改8080端口配置
#sudo vi conf/server.xml  

下载maven

wget  http://mirror.bit.edu.cn/apache/maven/maven-3/3.6.1/binaries/apache-maven-3.6.1-bin.tar.gz

安装

tar vxf apache-maven-3.6.1-bin.tar.gz
mv apache-maven-3.6.1 /usr/local/maven3
vi /etc/profile

修改如下:

export MAVEN_HOME=/usr/local/maven3
export PATH=${JAVA_HOME}/bin:/usr/local/apache-tomcat-9.0.21/bin/:${MAVEN_HOME}/bin:$PATH

执行source /etc/profile使环境变量生效

你可能感兴趣的:(java)