Centos installation Java (JDK) and Jenkins

Source: Internet
Author: User

One

Download JDK

Http://www.oracle.com/technetwork/java/javase/downloads/index.html

I chose the tar package to install

Jdk-8u25-linux-x64.gz

Upload the JDK installation package to the server

Unzip to get folder Jdk1.8.0_25

MV JDK1.8.0_25/USR/LOCAL/JDK

(Put Java in the/usr/local/directory and rename the JDK.) Personal habits)

Then add the environment variable

Vim/etc/profile

Add at the end of the file

Export JAVA_HOME=/USR/LOCAL/JDK

Export classpath=.: $JAVA _home/jre/lib/rt.jar: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar

Export path= $PATH: $JAVA _home/bin

Save exit

Source/etc/profile

Re-loaded into force.


Two

Add yum sources to your website

sudo wget-o/etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.reposudo rpm--import/http Pkg.jenkins-ci.org/redhat/jenkins-ci.org.key

Then direct yum installation

Yum Install Jenkins

or download Jenkins ' rpm package directly

http://pkg.jenkins-ci.org/redhat/

Uploading the server, performing the installation

RPM-IVH jenkins-1.589-1.1.noarch.rpm

After the default installation.

The relevant directory for Jenkins

[[email protected]/]# find. -name Jenkins

./usr/lib/jenkins

./etc/logrotate.d/jenkins

./etc/sysconfig/jenkins

./etc/rc.d/init.d/jenkins

./var/lib/jenkins

./var/log/jenkins

./var/cache/jenkins

Configuration modifications

Add the path to Java in/etc/rc.d/init.d/jenkins (or modify/etc/init.d/jenkins This is the previous soft connection)

Vim/etc/rc.d/init.d/jenkins

Add the previously installed JDK path in the candidates option

Candidates= "

/usr/lib/jvm/jre-1.8.0/bin/java

/usr/bin/java

/usr/local/jdk/bin/java

"

Start with service Jenkins start

If you need to modify the configuration, you can modify it in the/etc/sysconfig/jenkins file. Restart takes effect

Centos installation Java (JDK) and Jenkins

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.