当前位置:网站首页>把xshell連接服務器關掉,運行的jar包就自動停止的解决方案
把xshell連接服務器關掉,運行的jar包就自動停止的解决方案
2022-07-02 17:48: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 &
边栏推荐
- 【网络是怎样连接的】第六章 请求到达服务器以及响应给客户端(完结)
- What are the green field and brown field models in software development - green field development and brown field development
- JS20 数组扁平化
- Si446 usage record (II): generate header files using wds3
- Daily question - xiaolele changes the number
- 嵌入式 ~ 介绍
- [nonlinear control theory]8_ Comparison of three robust controllers
- List summation [dummy+ tail interpolation + function processing list reference common pit]
- Vscode + eslint configuration
- 如何给 SAP Spartacus Storefront 创建新的页面
猜你喜欢
![[comment le réseau se connecte] chapitre 6: demande d'accès au serveur et réponse au client (terminé)](/img/ef/1ac272dbd0e5c4d08a8f01f61d334d.png)
[comment le réseau se connecte] chapitre 6: demande d'accès au serveur et réponse au client (terminé)
![[web technology] 1233 seconds understand web component](/img/42/c98d8112dc4ece0a92dda97647be5c.jpg)
[web technology] 1233 seconds understand web component

The construction of scalable distributed database cluster and the partition design of oneproxy sub database

从收集到输出:盘点那些强大的知识管理工具——优秀笔记软件盘点(四)

What is the experience of maintaining Wanxing open source vector database

Keras深度学习实战——基于VGG19模型实现性别分类

MB10M-ASEMI整流桥MB10M

pytorch支持32位吗?

Income and risk of linear programming example investment

我的创作纪念日
随机推荐
The difference between class and getClass ()
The construction of scalable distributed database cluster and the partition design of oneproxy sub database
RK1126平台项目总结
泡椒凤爪制作教程
外包干了五年,废了...
SSB threshold_ SSB modulation "suggestions collection"
每日一题——小乐乐改数字
[today in history] July 2: BitTorrent came out; The commercial system linspire was acquired; Sony deploys Playstation now
Longest non repeating subarray
Configure lamp+supervisor
PFC232-SOP8/14/16应广一级可带烧录程序编带
Solving simple differential equations
Rk1126 platform project summary
VirtualLab基础实验教程-7.偏振(2)
Modbus协议通信异常
helm kubernetes包管理工具
牛客 JS3 分隔符
Daily question - inverted string
PMS150C应广单片机开发案例
应广单片机(MCU单片机科普)