# sudo /etc/init.d/jenkins restart
ERROR: No Java executable found in current PATH: /bin:/usr/bin:/sbin:/usr/sbin
If you actually have java installed on the system make sure the executable is in the aforementioned path and that 'type -p java' returns the java executable path
2.启动时遇到报错ERROR: No Java executable found in current PATH: /bin:/usr/bin:/sbin:/usr/sbin
解决办法:
①.先执行echo $PATH 看看环境变量运行结果如下:
/usr/maven/maven/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/java/jdk1.8/bin
如果连这都没有的话重新安装Java。
②.建立软连接:ln -s /usr/java/jdk1.8/bin/java /usr/bin/java(换成你自己的路径)
注意:jenkins的默认端口是8080,如果8080被占用记得去改一下在/etc/default/jenkins这个文件改,改成8081或者其他的都可以
最后重启:service jenkins restart
OK 了!
————————————————
版权声明:本文为CSDN博主「一蓑烟雨y」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/yi_suo_yan_yu/article/details/81981789