First of all, you must ensure that you have a java environment on your server.
If not, you can refer to my article
to install java JDK1.8 version in the linux server.
Then we open our Spring Boot project,
double-click the package life cycle to package and
package. After we find the target, there will be A jar package, then we right-click it to operate as shown in the figure below,
the system will help you open the directory where it is located,
then we open the terminal in this directory
, and then we execute
scp -r ./WebDom-0.0.1-SNAPSHOT.jar 用户名(如果之前没设置过就是 root)@服务器公网地址:/
You need to find the corresponding information here.
Here you need to enter the password.
Finally, if you can output the following content, it means success.
Then we come to the linux server and
enter
cd /
Go back to the top-level directory
and enter
ll
View the file to see our file and
then we execute
java -jar WebDom-0.0.1-SNAPSHOT.jar
Run this program
and the project will start