For installing jenkins on Ubuntu 14.04 using Java RPM do the following steps.

Step 1: Download java tar ball file from http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Step 2: Scp the files from your local machine to your server

Step 3: Install java

sudo tar xvzf jdk-8u5-linux-i586.tar.gz -C /usr/java

Step 4: Setup java. I downloaded and installed java 8 update 151 so executed the following lines on the command prompt.

JAVA_HOME=/usr/java/jdk1.8.0_151/

sudo update-alternatives --install /usr/bin/java java ${JAVA_HOME%*/}/bin/java 20000

sudo update-alternatives --install /usr/bin/javac javac ${JAVA_HOME%*/}/bin/javac 20000

Step 5: Choose the correct java version. For jenkins we want to use java 8(i.e. java 1.8 jdk)

update-alternatives --config java

Step 6: Test your java version with

java -version

Step 7: Add jenkins to your repository list and install jenkins

wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -

sudo echo "deb https://pkg.jenkins.io/debian binary/" >> /etc/apt/sources.list

sudo apt-get update

sudo apt-get install jenkins

Step 8: Start jenkins. Jenkins by default uses port 8080. Make sure it is not being used. This command should start jenkins.

sudo /etc/init.d/jenkins start || sudo /etc/init.d/jenkins restart

Step 9: Get default username and password

sudo cat /var/lib/jenkins/secrets/initialAdminPassword


0 Comments

What do you think?