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