当前位置:网站首页>把xshell连接服务器关掉,运行的jar包就自动停止的解决方案
把xshell连接服务器关掉,运行的jar包就自动停止的解决方案
2022-07-02 15:50:00 【梁萌】
使用Xshell连接服务器时,启动项目之后,可以正常运行,一旦将Xshell关闭,项目就会自动关闭。
说明Xshell终端对项目产生了一定的影响,需要换一种项目启动方式。
解决方式
原来的启动方式:
1.窗口被锁定,可按CTRL + C打断程序运行,关闭窗口程序停止运行
java -jar xxx.jar
2.窗口不被锁定,关闭窗口时,程序停止运行
java -jar xxx.jar &
修改后的启动方式:
1.nohup 意思是不挂断运行,当账户退出或终端关闭时,程序仍然运行,日志内容默认存入nohup.out 文件内
nohup java -jar xxx.jar
2.nohup启动的日志输出文件nohup.out是自动生成的,但是我们更希望自己指定日志输出文件,比如输出日志到logs.log文件中,用以下命令:
nohup java -jar xxx.jar > logs.log &
边栏推荐
- JDBC
- List summation [dummy+ tail interpolation + function processing list reference common pit]
- Update iteration of cloud communication interface -- the official launch of subail API V4
- uniapp H5页面调用微信支付
- Laravel文档阅读笔记-Custom Authentication Login And Registration Using Laravel 8
- 嵌入式 ~ 介绍
- 一日2篇Nature!中科大校友段镶锋团队纳米材料新成果,曾是贝尔比奖章第三位华人得主...
- 如何给 SAP Spartacus Storefront 创建新的页面
- Si446 usage record (I): basic data acquisition
- uva1169
猜你喜欢
台湾飞凌FM8PB513B单片机提供单片机方案开发 产品设计
Daily question - inverted string
线性规划例题 投资的收益与风险
Map集合详细讲解
【曆史上的今天】7 月 2 日:BitTorrent 問世;商業系統 Linspire 被收購;索尼部署 PlayStation Now
[非线性控制理论]7_High gain and High Frequency
MATLAB中nexttile函数使用
每日一题——倒置字符串
Virtual lab basic experiment tutorial -7 Polarization (1)
USB interface powered Bluetooth color light strip controller
随机推荐
【GAMES101】作业4 Bézier 曲线
【网络是怎样连接的】第六章 请求到达服务器以及响应给客户端(完结)
Income and risk of linear programming example investment
从收集到输出:盘点那些强大的知识管理工具——优秀笔记软件盘点(四)
微信小程序 —— 上下浮动的箭头
Wechat applet - arrows floating up and down
Virtual lab basic experiment tutorial -7 Polarization (2)
求简单微分方程
线性规划例题 投资的收益与风险
freemarker+poi实现动态生成excel文件及解析excel文件
Keras深度学习实战——基于VGG19模型实现性别分类
MB10M-ASEMI整流桥MB10M
维护万星开源向量数据库是什么体验
[nonlinear control theory]7_ High gain and High Frequency
The construction of scalable distributed database cluster and the partition design of oneproxy sub database
第十五章 字符串本地化和消息字典(一)
List summation [dummy+ tail interpolation + function processing list reference common pit]
JDBC
Alibaba Tianchi SQL learning notes - Day3
台湾飞凌FM8PB513B单片机提供单片机方案开发 产品设计