How to run jar package in linux system?

王林
Release: 2020-06-15 17:37:52
forward
5161 people have browsed it

How to run jar package in linux system?

When we need to run a Java program developed on Windows on Linux, we need to package the Java program into a jar package and upload it to Linux.

The following are several ways to start jar packages in the background under Linux:

Method 1:

java -jar xxx.jar &
Copy after login

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

Method 2:

nohup java -jar xxx.jar &
Copy after login

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

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.

Method 3:

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

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

Recommended tutorial:linux tutorial

The above is the detailed content of How to run 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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!