Setup Java

Java is a computer programming language that is concurrent, class-based, object-oriented, and specifically designed to have as few implementation dependencies as possible. Here is easy way to setup java on Centos 6, and choose it version

  1. Download and setup Java: Oracle Java

    tar -xzf jdk-7u79-linux-x64.tar.gz
    mv jdk1.7.0_79 /opt/
  2. Configure Java

    cd /opt/jdk1.7.0_79
    alternatives --install /usr/bin/java java /opt/jdk1.7.0_79/bin/java 5
    alternatives --config java
  3. Declare JAVA_HOME

    vi $HOME/.bash_profile
    # add following export command after line "export PATH"
    export JAVA_HOME=/opt/jdk1.7.0_79
    export JRE_HOME=/opt/jdk1.7.0_79/jre
    export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
  4. Reload .bash_profile

    source $HOME/.bash_profile
  5. Useful resources

    Snippet Java

    Increase Heap Size in Java

    How To Set TimeZone in Java


Popular posts from this blog