If the Java-jar xxx.jar& command is executed in the terminal, Xxx.jar will also end up running when the terminal is closed, but if the nohup java-jar xxx.jar& command is executed, the program will run in the background, and it is worth noting that The program console output is then transferred to the Nohup.out file.
attached: nohup command Reference nohup command
Purpose: To run the command without hanging off.
Syntax: Nohup Command [Arg ...] [&]
Description: The nohup command runs commands specified by the command parameter and any related ARG parameters, ignoring all hang-up (SIGHUP) signals. Use the Nohup command to run a program in the background after logging off. To run the Nohup command in the background, add & (the symbol representing "and") to the end of the command.
。 If the nohup.out file for the current directory is not writable, the output is redirected to the $HOME/nohup.out file. If no file can be created or opened for appending, then the command specified by the commands parameter is not callable. If the standard error is a terminal, then all output of the specified command to the standard error is redirected to the same file descriptor as the standard output.
Keep Java programs running in the background (for example, the daemon continues to run after Putty is closed)