Friday, March 14, 2014

Installation of required basic tools on CentOS

Install Java (Make sure to install Java Development Environment):


$ sudo yum install java-1.7.0-openjdk-devel –y

Set up JAVA_HOME environment variable:
$ sudo vim /etc/profile.d/java.sh
export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.51.x86_64/

Verify
$ java -version
java version "1.7.0_51"
OpenJDK Runtime Environment (rhel-2.4.4.1.el6_5-x86_64 u51-b02)
OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)

Add java to PATH
export PATH=$PATH:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.51.x86_64/bin

Verify
echo $PATH
/usr/local/maven/bin:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.51.x86_64//bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/root/bin

Install Maven (we will need that to build our Accumulo)


Create maven directory to keep things neat:
$ sudo mkdir /opt/maven
$ cd /opt/maven

Download the latest Maven binary from the official site: http://maven.apache.org/download.cgi
$ wget http://www.carfab.com/apachesoftware/maven/maven-3/3.2.1/binaries/apache-maven-3.2.1-bin.tar.gz
$ sudo tar xzf apache-maven-3.2.1-bin.tar.gz -C /usr/local
$ cd /usr/local
$ sudo ln -s apache-maven-3.2.1 maven

Set up M2_HOME and add maven to your path
$ sudo vi /etc/profile.d/maven.sh
export M2_HOME=/usr/local/maven
export PATH=${M2_HOME}/bin:${PATH}

Finally, log out and log in again to activate the above environment variables.

To verify successful installation of maven, check the version of maven:
$ mvn -version

Note: If you are using maven behind proxy, you need to configure $ vim ~/.m2/settings.xml
<settings>
  <proxies>
    <proxy>
      <active>true</active>
      <protocol>http</protocol>
      <host>proxy.host.com</host>
      <port>port_number</port>
      <username>proxy_user</username>
      <password>proxy_user_password</password>
      <nonProxyHosts>www.google.com</nonProxyHosts>
    </proxy>
  </proxies>
</settings>

Install git to be able to pull/push from Accumulo repository


$ sudo yum install git

Configure git

$ git config --global user.name "Your Name Here"
$ git config --global user.email "your_email@example.com"

To verify the changes $ vim ~/.gitconfig
You should see something like
[user]
        name = Your Name Here
        email = your_email@example.com

No comments:

Post a Comment