CentOS-6.4-minimal版中安裝JDK_Maven_Subversion以及修改rpm包安裝路徑,centossubversion

來源:互聯網
上載者:User

CentOS-6.4-minimal版中安裝JDK_Maven_Subversion以及修改rpm包安裝路徑,centossubversion

/** * @see ------------------------------------------------------------------------------------------------- * @see 安裝JDK * @see [root@CentOS64 ~]# cd / * @see [root@CentOS64 /]# mkdir app * @see [root@CentOS64 ~]# groupadd Develop                            #添加Develop組 * @see [root@CentOS64 ~]# useradd -g Develop Jadyer                   #建立Jadyer使用者並將其分配到Develop組 * @see [root@CentOS64 ~]# passwd Jadyer                               #設定或修改Jadyer使用者密碼 * @see [root@CentOS64 /]# chown -R Jadyer:Develop /app                #將/app目錄的擁有者修改為Jadyer使用者和Develop組 * @see [Jadyer@CentOS64 software]$ tar zxvf jdk-8u40-linux-x64.tar.gz #解壓jdk * @see [Jadyer@CentOS64 software]$ mv jdk1.8.0_40/ /app/jdk1.8.0_40   #統一存放應用在/app目錄中 * @see [root@CentOS64 ~]# vi /etc/profile                             #配置環境變數,最後[:x]儲存即可 * @see                       #Set Java Environment Variable * @see                       JAVA_HOME=/app/jdk1.8.0_40 * @see                       PATH=$PATH:$JAVA_HOME/bin * @see                       export JAVA_HOME PATH * @see [root@CentOS64 ~]# echo $PATH                                  #查看當前PATH * @see [root@CentOS64 ~]# source /etc/profile                         #令環境變數生效 * @see [root@CentOS64 ~]# echo $PATH                                  #再看下PATH * @see [root@CentOS64 ~]# java -version                               #驗證是否成功 * @see [Jadyer@CentOS64 ~]$ java -version                             #重複驗證(普通使用者重連伺服器後才會生效) * @see ------------------------------------------------------------------------------------------------- * @see 安裝Maven * @see [Jadyer@localhost ~]$ cd /app/ * @see [Jadyer@localhost app]$ tar -zxvf apache-maven-3.2.5-bin.tar.gz * @see [Jadyer@localhost app]$ rm -rf apache-maven-3.2.5-bin.tar.gz * @see [root@localhost Jadyer]# vi /etc/profile * @see                          #Set Maven Environment Variable * @see                          MAVEN_HOME=/app/apache-maven-3.2.5 * @see                          PATH=$PATH:$MAVEN_HOME/bin * @see                          export MAVEN_HOME PATH * @see [root@localhost Jadyer]# source /etc/profile * @see [root@localhost Jadyer]# echo $PATH * @see [root@localhost Jadyer]# mvn -version * @see [Jadyer@localhost ~]$ mvn -version * @see [Jadyer@localhost ~]$ cd /app/code/ * @see [Jadyer@localhost code]$ mkdir MavenRepository * @see [Jadyer@localhost code]$ vi /app/apache-maven-3.2.5/conf/settings.xml * @see                          <localRepository>/app/code/MavenRepository</localRepository> * @see [Jadyer@localhost code]$ cp /app/apache-maven-3.2.5/conf/settings.xml MavenRepository/ * @see ------------------------------------------------------------------------------------------------- * @see 安裝Subversion * @see https://www.open.collab.net/files/documents/60/11125/CollabNetSubversion-client-1.8.13-1.x86_64.rpm * @see [Jadyer@localhost ~]$ rpm -q Subversion * @see [Jadyer@localhost ~]$ rpm -ivh /app/CollabNetSubversion-client-1.8.13-1.x86_64.rpm * @see warning: /app/CollabNetSubversion-client-1.8.13-1.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 35bcca43: NOKEY * @see Preparing...                ########################################### [100%] * @see    1:CollabNetSubversion-cli########################################### [100%] * @see [root@localhost Jadyer]# svn --version * @see [root@localhost Jadyer]# vi /etc/profile * @see                          #Set Subversion Environment Variable * @see                          SVN_HOME=/opt/CollabNet_Subversion * @see                          PATH=$PATH:$SVN_HOME/bin * @see                          export SVN_HOME PATH * @see [root@localhost Jadyer]# source /etc/profile * @see [root@localhost Jadyer]# svn --version * @see [Jadyer@localhost ~]$ svn --version * @see ------------------------------------------------------------------------------------------------- * @create 2015-5-27 下午3:19:19 * @author 玄玉<http://blog.csdn.net/jadyer> */
/** * @see ------------------------------------------------------------------------------------------------- * @see 關於rpm的安裝路徑 * @see rpm包通常都有預設的安裝路徑,但也有辦法更新它的預設安裝路徑,只不過不是所有的rpm都允許安裝到其它路徑 * @see 下面以CollabNetSubversion-client-1.8.13-1.x86_64.rpm和jdk-6u45-linux-amd64.rpm為例 * @see ------------------------------------------------------------------------------------------------- * @see [Jadyer@localhost app]$ rpm -qpi CollabNetSubversion-client-1.8.13-1.x86_64.rpm * @see warning: CollabNetSubversion-client-1.8.13-1.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 35bcca43: NOKEY * @see Name        : CollabNetSubversion-client   Relocations: (not relocatable) * @see Version     : 1.8.13                            Vendor: CollabNet * @see Release     : 1                             Build Date: Mon 23 Mar 2015 02:49:36 AM EDT * @see Install Date: (not installed)               Build Host: cu128.cloud.maa.collab.net * @see Group       : Utilities/System              Source RPM: CollabNetSubversion-client-1.8.13-1.src.rpm * @see Size        : 39281894                         License: Proprietary * @see Signature   : DSA/SHA1, Mon 23 Mar 2015 02:49:51 AM EDT, Key ID 80233a5a35bcca43 * @see Packager    : Alexander Thomas (AT) <alexander@collab.net> * @see URL         : http://open.collab.net * @see Summary     : A Concurrent Versioning system similar to but better than CVS. * @see Description : * @see CollabNet Subversion client is a free download of open-source Subversion, * @see compiled and tested by CollabNet. For more information about CollabNet * @see Subversion, visit the CollabNet community at http://open.collab.net. * @see ------------------------------------------------------------------------------------------------- * @see [Jadyer@localhost app]$ rpm -qpi jdk-6u45-linux-amd64.rpm * @see Name        : jdk                          Relocations: /usr/java  * @see Version     : 1.6.0_45                          Vendor: Oracle and/or its affiliates. * @see Release     : fcs                           Build Date: Tue 26 Mar 2013 07:54:12 PM EDT * @see Install Date: (not installed)               Build Host: jb6-lin-amd64.sfbay.sun.com * @see Group       : Development/Tools             Source RPM: jdk-1.6.0_45-fcs.src.rpm * @see Size        : 127250396                        License: Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. Also under other license(s) as shown at the Description field. * @see Signature   : (none) * @see Packager    : Java Software <jre-comments@java.sun.com> * @see URL         : http://www.oracle.com/technetwork/java/javase/overview/index.html * @see Summary     : Java(TM) Platform Standard Edition Development Kit * @see Description : * @see The Java Platform Standard Edition Development Kit (JDK) includes both * @see the runtime environment (Java virtual machine, the Java platform classes * @see and supporting files) and development tools (compilers, debuggers, * @see tool libraries and other tools). * @see  * @see The JDK is a development environment for building applications, applets * @see and components that can be deployed with the Java Platform Standard * @see Edition Runtime Environment. * @see ------------------------------------------------------------------------------------------------- * @see 通過二者的Relocations參數,我們可以看到Subversion是不允許重定位的,而jdk則允許 * @see 所以,Subversion只能安裝在預設路徑下,而jdk則可以修改其預設安裝路徑/usr/java為其它路徑,方法如下 * @see [Jadyer@localhost app]$ rpm -ivh --badreloc --relocate /usr/java=/app/jdk1.6.0_45 jdk-6u45-linux-amd64.rpm * @see badreloc是將檔案強制安裝到指定位置 * @see relocate是將檔案從oldpath安裝到newpath * @see ------------------------------------------------------------------------------------------------- * @create 2015-5-27 下午7:08:43 * @author 玄玉<http://blog.csdn.net/jadyer> */

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.