在Linux下后台运行jar包文件

##进入对应的目录执行下面的命令
nohup java -jar F_Server.jar /null &>/dev/null &

值得注意的是,需要在命令后面添加这一句

/null &>/dev/null &

  

否则会报nohup: ignoring input and appending output to ‘nohup.out这个错误

如果添加也报错可以尝试在前面切换到管理员,即
sudo  nohup java -jar F_Server.jar /null &>/dev/null &

但如果是我添加,反而报错,这大概因为我启动的就是root用户

猜你喜欢

转载自www.cnblogs.com/inthecloud/p/11469811.html