admin 管理员组

文章数量: 1086019

linux搭建jenkins环境变量,在Linux系统中安装Jenkins的方法(原创)

Jenkins安装手册

一、前期准备工作

因为我是在Windows系统下载的安装包上传到Linux系统,所以需要用到两个工具---putty和FileZilla。GXV7^I~y7Tb0

Putty是一个免费的、Windows 32平台下的telnet、rlogin和ssh客户端,但是功能丝毫不逊色于商业的telnet类工具。 用它来远程管理Linux十分好用。51Testing软件测试网8I_-V#hEi3L/i6Z

FileZilla是一种快速、可信赖的FTP客户端以及服务器端开放源代码程式,具有多种特色、直觉的接口。51Testing软件测试网o4w,uA1S

这两款工具都是免安装的,使用非常方便。n#GIgC7{ M{$B7O)g0

Q#_LIP9b)cI0

2.1卸载linux上自带的jdk

用root用户登陆到系统,打开一个终端输入51Testing软件测试网p4E5O"R?

# rpm -qa|grep gcj

Jy5~9Ojd1B|0显示内容其中包含下面两行信息51Testing软件测试网/ZF^fCtO

# java-1.4.2-gcj-compat-1.4.2.0-27jpp

nNQ]"nP)g0# java-1.4.2-gcj-compat-devel-l.4.2.0-27jpp

0`uF,S

E$MU0卸载51Testing软件测试网ni:]yw/uE5o/Gn

# rpm -e java-1.4.2-gcj-compat-devel-l.4.2.0-27jpp

(iYEq9d bo0# rpm -e java-1.4.2-gcj-compat-l.4.2.0-27jpp6C_+Bw~b0

卸载其他自己安装的JDK就直接用rpm

-e 51Testing软件测试网Q0A3k

M2Fm'@e卸载rpm版的jdk:@/\0{S0i.d7S0

#rpm -qa|grep jdk51Testing软件测试网

WO3sh2xv;~6vdG

显示:jdk-1.6.0_10-fcs51Testing软件测试网PZ] Ev.J Z [X5S卸载:#rpm -e  --nodeps

jdk-1.6.0_10-fcsv;~IDI0

51Testing软件测试网(t9vjDxoo2yO

2.2安装JDK

去.html拿1.6.0举例,下载一个Linux Platform的JDK,建议下载RPM格式的(我下载的是Linux x86 (32-bit)的名称为jdk-6u32-linux-i586-rpm.bin的jdk)8]"mE @1LaV@0

51Testing软件测试网h*i:r}*TG^WQ

2.2把刚才第一步下载的bin文件上传到Linux服务器上,在H@[w6IL6{*Cl0

注:我的jdk安装包放在home目录下51Testing软件测试网X7{K/p!y_-D

[root@testdep

home]# chmod 755 jdk-6u32-linux-i586-rpm.bin

'm9|h*nV(g0[root@testdep home]# ./ jdk-6u32-linux-i586-rpm.bin51Testing软件测试网(l.FdYpR(z

\rAdy'V?%MX0

这时会有一段Sun的协议如下51Testing软件测试网j9X?~M:B

^

准备中… ######################################## [100%]51Testing软件测试网*^&tkn!B iwS+c

1:jdk

######################################## [100%]51Testing软件测试网NB{9FTca({v}

Unpacking

JAR files...51Testing软件测试网5MK_&~6y'i,j4HG

rt.jar...0BnC;U3D6o9O0

jsse.jar...51Testing软件测试网7Hs)znY~![A

charsets.jar...51Testing软件测试网a2w!F0X%b Du;?

tools.jar...51Testing软件测试网X5k!r3Jm*dX

localedata.jar...#\weM5mI7@\%P0

plugin.jar...51Testing软件测试网/\]f;VpOUFl

javaws.jar...51Testing软件测试网:d9_O(t$D0|9@ep4DBS

deploy.jar...51Testing软件测试网f8Z MaR?-I

51Testing软件测试网#E8C7FOt"wa;J-d

Java(TM) SE Development Kit 6 successfully

installed.r0SATx ?}:d0

GuRZ:J3\s[0

Product

Registration is FREE and includes many benefits:51Testing软件测试网`D6@M"Hz%N

*

Notification of new versions, patches, and updates51Testing软件测试网2T"chNTQ

* Special

offers on Oracle products, services and training51Testing软件测试网)`

R"P;Z5V'k3Io2w

* Access to

early releases and documentation51Testing软件测试网&agUQq#Ue

^CsIKTRC0

Product and

system data will be collected. If your configuration51Testing软件测试网Praum"L8?

supports a

browser, the JDK Product Registration form. will~8uf

N1D!~#L

hd!E5DC{0

be

presented. If you do not register, none of this information9kIdhy0

will be

saved. You may also register your JDK later by!E9N.t'G;@X2N;A0

opening the

register.html file (located in the JDK installation51Testing软件测试网7{{.j{uW2n}]

directory)

in a browser.51Testing软件测试网S'e)j*p#||6xu

:Dkg9g,lK.|0

For more information on what data

Registration collects andb&qK%S-fXz0

how it is

managed and used, see:51Testing软件测试网3[G7{l0l+@/Jv

.html51Testing软件测试网*`e#oY8w_k

:O1l7Gn1qw,S*{0

Press Enter to continue.....51Testing软件测试网)|4u)b*WTu

i1\][AV!e;|L0

0N5b9S)S4|%dDy0

Done.%L:R9B!ZC5e{H0

2.3安装jdk主程序包

程序会自动生成一个jdk-6u32-linux-i586.rpm文件,这是主程序包,下面来安装;51Testing软件测试网;K+mO,Y$b+`3T#RF

[root@testdep

home]#rpm –ivh jdk-6u32-linux-i586.rpm51Testing软件测试网st0|Kmw

51Testing软件测试网$UMg1BzXa{R

2.4设置环境变量

通常都喜欢用export命令直接在shell下设置OF[RX.?0

[root@ testdep

home]# export JAVA_HOME=/usr/java/jdk1.6.0_3251Testing软件测试网0`(YKv2x

[root@ testdep home]# export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

7T'D9o&eF0[root@ testdep home]# export PATH=$PATH:$JAVA_HOME/bin

\@{&P/S;cH0当然这样设置环境变量是可以生效的,但是只对当前shell生效。如果从另外一个shell登陆,将不能使用刚才设置的变量。所以最好的方法还是修改.bashrc文件。`Cb$D/pEI0我用下面这个51Testing软件测试网S?djcf[c1U!t

cd ~     .bashrc是在根目录下51Testing软件测试网2QFL\)H~7L

[root@testdep ~]#vi .bashrc51Testing软件测试网PM7qIE

export JAVA_HOME=/usr/java/jdk1.6.0_32(这里的jdk的版本号可以通过cd

/usr/java查看)51Testing软件测试网x'VU+_O2~:ewp2E4Hxt

export JAVA_HOME

本文标签: linux搭建jenkins环境变量 在Linux系统中安装Jenkins的方法(原创)