Deploy jar package

Step 1: Use maven in the Idea compiler to build the jar package

Step 2: The prepared jar package will be in the target directory. After finding it, upload the jar package to the server.

Step 4: Enter the directory where the server-side jar is located and run the command:

"""
nohup 意思是不挂断运行命令,当账户退出或终端关闭时,程序仍然运行
>temp.txt 会把日志文件输入到你指定的文件中,缺省情况下该作业的所有输出被重定向到nohup.out的文件中
"""
nohup java -jar test.jar >temp.txt &

Note: There is usually a default port number for the program to run. To ensure that the program runs on the specified port number, you can use the following command:

# 查看端口号是否被占用
lsof -i:端口号
# 效果一样
netstat -tunlp | grep 端口号

If the port number is occupied, you can use the kill command:

kill -9 端口号对应的PID

Guess you like

Origin blog.csdn.net/qq_52495709/article/details/134601745