nohup: failed to run command ‘java‘: No such file or directory

Linux jar包后台启动是时候报nohup: failed to run command 'java': No such file or directory,

解决办法:

1、检查执行该shell的服务器有没有装jdk

2、检查执行该shell的服务器的环境变量有没有将JAVA_HOME/bin加入(目的是可以在linux任意位置执行java命令)

3、先执行:source /etc/profile 然后执行:nohup java -jar ...

4、我的执行命令是:sudo nohup java -jar ,把sudo去掉就解决了,这个是我本次出现问题的解决方案

猜你喜欢

转载自blog.csdn.net/poxiao58/article/details/111194573