Requirement: For 64bit
a) Install JDK, download jdk-7u71-linux-x64.tar.gz
   use root to do
        tar -zxvf jdk-7u71-linux-x64.tar.gz 
        mv jdk1.7.0_71 /usr/java/jdk1.7.0_71/
   
   Configure Java_home and Classpath in /etc/profile   
    export JAVA_HOME=/usr/java/jdk1.7.0_71
    export CLASSPATH=.:$JAVA_HOME/bin/dt.jar:$JAVA_HOME/lib/tools.jar
1: Obtain R source code
    wget http://cran.r-project.org/src/base/R-3/R-3.1.1.tar.gz
2: Create a directory in which you want to install R, e.g. /usr/R/. You can also use this directory for all other custom software you install.
3: Extract the tar.gz file you downloaded using tar
    tar ¨Czvxf R-3.1.1.tar.gz
4: Go into the R-3.1.1 directory. Give the following commands:
    ./configure --prefix=/usr/R/ --enable-R-shlib
   Remark: --enable-R-shlib can ensure the installation for rJava
    If there existing errors:
    4.1 congigure: error: gcc compiler 
        yum install gcc
    4.2 configure: error: No F77 compiler found, then use the following to install gcc-fortran
        yum install gcc-gfortran
    4.3 configure: error: C++ preprocessor "/lib/cpp" fails sanity check
        yum install glibc-headers        
        yum install gcc-c++    
    4.4 configure: error: --with-readline=yes (default) and headers/libs are not available
        yum install readline-devel
    4.5 configure: error: -¨Cwith-x=yes (default) and X11 headers/libs are not available
        yum install libXt-devel
5: Install R
    make
    make install
6: Add /usr/R/bin/ to your PATH environment variable. Easiest is to add a line to your etc/profile or .bashrc
    export PATH=/usr/R/bin/:$PATH
7: Ensure Java install on your linux and make sure the following configuration for R and Java.
    export JAVA_HOME=/usr/java/jdk1.7.0_71
    export CLASSPATH=.:$JAVA_HOME/bin/dt.jar:$JAVA_HOME/lib/tools.jar
    export R_HOME=/usr/R/lib64/R
    export R_DOC=$R_HOME/doc
    export R_INCLUDE_DIR=$R_HOME/include
    export R_SHARE_DIR=$R_HOME/share
    export PATH=$PATH:$JAVA_HOME/bin:$R_HOME/lib