Home > System Tutorial > LINUX > body text

Teach you how to execute Java jar package in Linux system

王林
Release: 2024-01-04 10:24:21
forward
1618 people have browsed it

Introduction to the method of running jar packages under LinuxWhen you need to use a Java program developed on Windows to run on Linux, you need to package the Java program into a jar package Upload it to Linux and run it. The following content will introduce several methods of starting jar packages in the background under Linux.

Optimization method one:

java -jar xxx.jar &

& means running in the background, the ssh window is not locked, but when the window is closed, the program will still exit

Optimization method two:

nohup java -jar xxx.jar &

nohup means running the command line without hanging up. When the account exits or closes the terminal, the program still runs

When a job is executed with the nohup command, all output of the job is redirected to the nohup.out file, unless an output file is otherwise specified.

Optimization method three:

nohup java -jar xxx.jar >/usr/local/temp.txt &

> /usr/local/temp.txt means recording all startup log information into the temp.txt file

The above is the detailed content of Teach you how to execute Java jar package in Linux system. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:jb51.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template