Linux quick start SpringBoot project

insert image description here

Personal brief introduction: New star creator in the Java field; Alibaba cloud technology blogger, star blogger, expert blogger; on the way of learning Java, recording the learning process~ Personal homepage: .29.'s blog
Learning community
: Go in and have a stroll~

insert image description here



1. Check the JDK version


  • Please ensure that the java version used by the SpringBoot project is consistent with the version installed in Linux
java -version

insert image description here




2. Import the Boot project jar package


  1. 使用maven命令打包工程

insert image description here


  1. 打开工程jar目录

insert image description here


  1. jar包导入到linux
cd /          #进入根目录
cd usr        #进入usr目录
mkdir BootApp #创建BootApp目录
  • Then import the project jar package into the BootApp directory we created:

insert image description here




3. Start the Boot project


  1. 前台启动Boot工程
java -jar  springboot-SSMP-0.0.1-SNAPSHOT.jar

insert image description here


  1. 后台启动Boot工程
  • > server.log: input logs into this file
  • 2>&1: redirect standard error output to standard output
nohup java -jar  springboot-SSMP-0.0.1-SNAPSHOT.jar > server.log 2>&1 &

What the command runs is the pid of the programinsert image description here


  1. 关闭后台启动的Boot工程
ps -ef | grep "java -jar"   #查找工程启动命令的pid
kill -9 67691               #消除Boot工程的进程

insert image description here




Four. Summary


  1. Boot program packaging depends on the Maven plug-in corresponding to SpringBoot to package executable jar packages
  2. Run the jar package using the jar command
  3. As long as the operating environment is valid, the Boot project can be executed smoothly


insert image description here

Guess you like

Origin blog.csdn.net/ebb29bbe/article/details/129955741