Use Python to execute the executable jar package.

There are many ways to execute jar generated by Spring boot. Here is the most commonly used example.
In the environment with java, you can run the spring boot project directly by using the following command

java -jar app.jar

One disadvantage of this method is that it can't run in the background.

In this case, you need to use a nohup command in linux

nohup command
Purpose: run the command without hanging up.
Syntax: nohup command [Arg []]
Description: the nohup Command runs the Command specified by the Command parameter and any related Arg parameters, ignoring all the sign up signals.
Use the nohup command to run programs in the background after logging out. To run the nohup command in the background, add & to the end of the command.

So just use the command nohup Java - jar website. Jar & to run the program in the background

Problem: to start multiple applications in the same environment and restart them, you need to find the corresponding PID to kill. However, when multiple applications are started, grep search will inevitably find multiple. In this way, there will be risks when killing.

Solution: save PID when application starts. Then kill according to PID

There is no corresponding Properties class in Python, so you need to implement a similar function

This class provides the functions of adding, modifying and querying

Realize interaction and make scripts more general. Here is the whole code of python