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~
Quick start SpringBoot project under Linux
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
2. Import the Boot project jar package
使用maven命令打包工程
:
打开工程jar目录
:
jar包导入到linux
:
cd / #进入根目录
cd usr #进入usr目录
mkdir BootApp #创建BootApp目录
- Then import the project jar package into the BootApp directory we created:
3. Start the Boot project
前台启动Boot工程
:
java -jar springboot-SSMP-0.0.1-SNAPSHOT.jar
后台启动Boot工程
:
> server.log
: input logs into this file2>&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 program
关闭后台启动的Boot工程
ps -ef | grep "java -jar" #查找工程启动命令的pid
kill -9 67691 #消除Boot工程的进程
Four. Summary
- Boot program packaging depends on the Maven plug-in corresponding to SpringBoot to package executable jar packages
- Run the jar package using the jar command
- As long as the operating environment is valid, the Boot project can be executed smoothly