在linux中启动类似服务的jar文件 [英] Start a jar file like service in linux

查看:243
本文介绍了在linux中启动类似服务的jar文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想按如下方式启动和停止我的jar文件

I want to start and stop my jar file as follows

service myService start

service myService stop

我当前运行的jar文件如下

my current jar file running as follows

cd /home/alex/IdeaProjects/myService
java -jar target/myService-SNAPSHOT-1.jar server config.yml

我该怎么办?

推荐答案

您需要Service Wrapper来运行Jar文件。

You need a Service Wrapper to run the Jar file.

有关init.d 这里。或者对于systemd(ubuntu 16+)这里

There are examples and instructions for init.d here. or for systemd (ubuntu 16+) here

这篇关于在linux中启动类似服务的jar文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆