1, the server needs to install the corresponding development version of the JDK
Download the JDK JDK version on your website and unzip it to a directory such as:
ls Jdk1. 8. 0_111 jdk-8u111-linux-x64. Tar. gz
Decompression command TAR-XZVF jdk-8u111-linux-x64.tar.gz
2. Add the following environment variables into Vi/etc/profile:
1 #jdk1. 8.0 ._111 2 java_home=/home/guchen/usr/java/jdk1. 8 .0_111 3 jre_home=/home/guchen/usr/java/jdk1. 8 . 0_111/jre 4 maven_home=/home/guchen/usr/local/apache-maven- 3.3 . 9 5 path= $PATH: $JAVA _home/bin: $JRE _home/bin: $MAVEN _home/ bin 6 classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar: $JRE _home/< Span style= "COLOR: #000000" >lib 7 export java_home jre_home maven_home PATH CLASSPATH
Save the environment variable after exit to take effect, execute: source/etc/profile
3. Install Tomcat
Download Tomcat and extract it to a directory such as:
ls Apache-maven-3.3. 9 apache-maven-3.3. 9-bin. tar. GZ apache-tomcat-7.0. apache-tomcat-7.0. . tar. gz
4. Put the war bag in the WebApps and restart Tomcat.
[Email protected]:/home/guchen/usr/local/apache-tomcat-7.0. the ls docs Examples host-manager Jenkins jenkins.war manager Operation-centre Operation-centre.war ROOT
Go to the bin directory to restart Tomcat and execute the command./startup.sh
[Email protected]:/home/guchen/usr/local/apache-tomcat-7.0. the/bin#./startup.SHUsing catalina_base:/home/guchen/usr/local/apache-tomcat-7.0. theUsing catalina_home:/home/guchen/usr/local/apache-tomcat-7.0. theUsing Catalina_tmpdir:/home/guchen/usr/local/apache-tomcat-7.0. the/tempusing jre_home:/home/guchen/usr/java/jdk1.8.0_111/jreusing CLASSPATH:/home/guchen/usr/local/apache-tomcat-7.0. the/bin/bootstrap.jar:/home/guchen/usr/local/apache-tomcat-7.0. the/bin/tomcat-Juli.jartomcat started. [Email protected]-ubuntu16-04lts:/home/guchen/usr/local/apache-tomcat-7.0. the/bin#
URL input ip:8080
If the Tomcat page appears, install OK
How to deploy a Java project (from the building environment)