Issues when configuring Jenkins in Ubuntu
Issues in Java path

Prerequisites
- Configure Java in Ubuntu
Installing Jenkins
Following commands need to be executed.
- First, add the repository key to the system
wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
2. Append the Debian package repository address to the server’s sources.list
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
3. When both of these are in place, run update
so that apt
will use the new repository:
sudo apt update
4. Finally, install Jenkins.
sudo apt install jenkins
5. Start Jenkins
sudo systemctl start jenkins
If you get the following error before starting Jenkins, follow the below steps.
Issue:
ERROR: No Java executable found in current PATH: /bin:/usr/bin:/sbin:/usr/sbin
Steps to follow
- Make sure PATH variable is exported correctly.
sudo vi /etc/profile
export JAVA_HOME="/home/ubuntu/jdk1.8.0_144/bin
source /etc/profile
2. Open /etc/init.d/jenkins file and append the path variable to the 6th line.
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/home/ubuntu/jdk1.8.0_144/bin
Reinstall Jenkins!!