linux 设置启动项开机运行jar

时间:2024-10-26 01:59:26

1、切换root用户:在终端输入su后,点击回车,输入root用户密码后,再回车

linux 设置启动项开机运行jar

2、编写一个启动jar包的脚本,位置随意,这里以/home/start.sh为例

linux 设置启动项开机运行jar

3、使用chmod命令,给脚本加入可执行权限。chmod +x /home/start.sh

linux 设置启动项开机运行jar

4、编辑文件/etc/rc.local,在最后一行处加入执行/home/start.sh命令,保存退出

linux 设置启动项开机运行jar

5、重起系统后,使用ps -ef|grep java命令,查看是否运行了java

linux 设置启动项开机运行jar
© 手抄报圈