CENTOS 安装 JDK, TOMCAT, ANT, MAVEN, SVN, Git, Jenkins

一,安装jdk
•  export JAVA_HOME=/usr/java/jdk1.7.0_03 
•  export JRE_HOME=/usr/java/jdk1.7.0_03/jre 
•  export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=.:$JAVA_HOME/bin: $PATH

二,安装tomcat
•  export TOMCAT_HOME=/usr/local/tomcat 
•  export CATALINA_HOME=/usr/local/tomcat 
•  export PATH= XXXXXXX:TOMCAT_HOME(在原有基础上面加)

Tomat常用的命令:
1,查看tomat进程: ps –ef
2, 启动服务:startup.sh
3,停止服务: shutdown.sh
4,功能合集:catalina.sh

三,安装ANT
export ANT_HOME=/usr/local/ant
export PATH= XXXXXXX: ANT_HOME(在原有基础上面加)
测试是否安装成功: ant –version

四,下载和安装maven
export M2_HOME=/usr/local/maven
PATH=:${M2_HOME}/bin:  (在原有基础上面加)
测试: mvn -v

五,安装SVN
yum install subversion

六,安装Git
1,在安装Git之前,我们先要安装一些依赖包:
# yum -y install zlib-devel openssl-devel perl perl-CPAN cpio expat-devel gettext-devel
# yum install autoconf
2,下载git:wget http://git-core.googlecode.com/download/files/git-1.8.3.4.tar.gz
3,修改文件权限:# chmod +x git-1.8.3.4.tar.gz
4,解压: # tar xzvf git-1.8.3.4.tar.gz
5,  安装:
# cd git-1.8.3.2
       # autoconf
       # ./configure
       # make
       # make install

七,安装Jenkins
1, 安装
方法一:
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo
sudo rpm --import http://pkg.jenkins-ci.org/redhat-stable/jenkins-ci.org.key
sudo yum install jenkins
方法二:
下载centos上面的版本的gz包,然后双击运行
2,安装后配置
-  安装完成后,/usr/lib/jenkins/:jenkins安装目录,WAR包会放在这里。
-  /etc/sysconfig/jenkins:jenkins配置文件,“端口”,“JENKINS_HOME”等都可以在这里配置
-  /var/lib/jenkins/:默认的JENKINS_HOME。
-  /var/log/jenkins/jenkins.log:Jenkins日志文件

3,启动Jenkins
$ sudo service jenkins start

有可能出现错误:“Starting Jenkins -bash: /usr/bin/java: No such file or directory”。表示找不到Jenkins找不到java。
这时就需要“vi /etc/init.d/jenkins”,把java路径加上
“for candidate in /etc/alternatives/java /usr/lib/jvm/java-1.6.0/bin/java /usr/lib/jvm/jre-1.6.0/bin/java /usr/lib/jvm/java-1 .5.0/bin/java /usr/lib/jvm/jre-1.5.0/bin/java /usr/bin/java /usr/j2sdk/bin/java
68 do”

你可能感兴趣的:(java,centos)