标准的 Java Web Tomcat 应用
标准的 Java Fatjar 应用
标准的 Spring Boot 应用
重启命令
sh /root/sh/restart-tomcat.sh
sh /root/sh/restart-java.sh
sh /root/sh/restart-springboot.sh
重启 脚本


source /etc/profile
killall java  (务必根据实际情况执行,如:jps   -ml. |grep  你要杀死的包名  |xargs. kill)
rm -rf /root/tomcat/webapps/javademo
sh /root/tomcat/bin/startup.sh



source /etc/profile
killall java
nohup java -jar /root/javademo/javademo-0.0.1-SNAPSHOT.jar > nohup.log 2>&1 &



source /etc/profile
killall java
nohup java -jar /root/springbootdemo/springbootdemo-0.0.1-SNAPSHOT.jar > nohup.log 2>&1 &


环境变量设置


# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
export JAVA_HOME=/usr/share/jdk1.8.0_14
export PATH=$JAVA_HOME/bin:.....



# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
export JAVA_HOME=/usr/share/jdk1.8.0_14
export PATH=$JAVA_HOME/bin:.....



# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
export JAVA_HOME=/usr/share/jdk1.8.0_14
export PATH=$JAVA_HOME/bin:.....