an安装jenkins时遇到ERROR: No Java executable found in current PATH: /bin:/usr/bin:/sbin:/usr/sbin的问题
1.安装按照官网推荐步骤(Ubuntu系统):wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/j
1.安装按照官网推荐步骤(Ubuntu系统):
wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install jenkins
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 了!
更多推荐
所有评论(0)