Saturday, April 18, 2015

Ubuntu 14.04 - Install Apache Tomcate – Set CATALINA_HOME

How to Install Apache Tomcat on Ubuntu System and set CATALINA_HOME environment variable.

Note: Verify you have jdk already installed or not ? if NOT then follow This tutorial.

There are two way to install tomcat
  1. Using apt-get
  2. Manually

Method 1 : Install Apache Tomcat with apt-get using below command

$ apt-get install tomcat7

above command will install the latest one available, for me it is apache-tomcat-7.0.59

Method 2 : Install Apache Tomcate Manually
  • First download the required version Binary Distributions/ ZIP file from apache.  
  • Once done with the download extract the file to /opt/, move to opt folder and execute below commands
    $ cd /opt
    $ sudo tar -xvzf ~/Downloads/apache-tomcat-*.tar.gz
  • Once extract done, you will see the apache-tomcat folder under /opt folder.


It is always helpful to set environment variable CATALINA_HOME for tomcate, I personally recommend to set it in .bashrc.

  • open bashrc using below command.
    $ sudo gedit ~/.bashrc
  • add below lines at the end of the bashrc file. DONE : Save and close the file. 
    # environment variable for tomcate 
    export CATALINA_HOME=/opt/apache-tomcat-7.0.59
    # environment variable for JAVA
    export JAVA_HOME=/usr/lib/jvm/java-7-oracle
  • make sure you have set the environment variable properly. 
    $ $CATALINA_HOME/bin/
    Tomcat should be started.  
    $ $CATALINA_HOME/bin/
    Tomcat should be shutdown.

Thursday, March 19, 2015

Ubuntu 14.04 | Install Latest Eclipse | Step by Step

How to Install The Latest Eclipse in Ubuntu 14.04

1. Verify you have jdk already installed or not ? if NOT then follow This tutorial.

2. Download latest Eclipse.

  •     Check your OS type > Click on Settings ICON  > System Settings > Details > Overview
  •     Then download eclipse from Here.

3. Extract Eclipse to default location /opt/ for global use.

  •  Open terminal and run the command below to extract Eclipse to /opt folder: 

     $ cd /opt  
     $ sudo tar -zxvf ~/Downloads/eclipse-*.tar.gz  
    • Once extract done, you will see the eclipse folder under /opt folder.
    4. Now Create a launcher for Eclipse
    • Go to Terminal and fire below command
     sudo gedit /usr/share/applications/eclipse.desktop  
    • command will create and open the eclipse.desktop file with gedit text editor, add below code to the file
     [Desktop Entry]  
     Name=Eclipse 4  
     Comment=Integrated Development Environment  
    • Save and Close the editor.
    DONE !! Now go to search and type eclipse and happy coding...

    Monday, March 16, 2015

    Ubuntu 14.04 | Install Oacle JDK | Step by Step

    Ubuntu users,... this article will help you to Install Oracle JAVA 7/8 (JDK/JRE) on Ubuntu 14.04 LTS, 12.04 LTS.

    There are two ways to install JDK in ubuntu.

    1) Using PPA.
    2) Manual installation.

    1) Using PPA.

    We can use WebUpd8 PPA (this will download the required files from Oracle).

    $ sudo apt-add-repository ppa:webupd8team/java  
    $ sudo apt-get update  
    $ sudo apt-get install oracle-java7-installer  
    $ sudo apt-get install oracle-java8-installer

    apt-get install will install the latest version available, now verify your Installed Java version using below command

    $ java -version 
    java version "1.7.0_56"

    Now set environment variables for the installed JAVA version.

    $ sudo update-alternatives --config java
    $ sudo apt-get install oracle-java7-set-default  
    $ sudo apt-get install oracle-java8-set-default

    2) Manual installation.
    In a manual installation we dont actually install java. The tar.gz provided by Oracle, we just extract those files to a location we want and add them to our path.

    So here is the manual process:

    1) Download a .tar.gz from Oracle official website

    2) Extract it to somewhere (/home/chirag/Downloads/);

    3) Move the extracted folder to /usr/lib/jvm.
    (This is not mandatory but it is the default place where Java runtime software is usually installed.)

     sudo mv /path/to/jdk /usr/lib/jvm/oracle_jdk7  

    4) Now configure ~/.bashrc to set the environment variable manually.

     sudo gedit ~/.bashrc

    and add below lines to the file - Save and close.
    export J2SDKDIR=/usr/lib/jvm/oracle_jdk7  
    export J2REDIR=/usr/lib/jvm/oracle_jdk7/jre  
    export PATH=$PATH:/usr/lib/jvm/oracle_jdk7/bin:/usr/lib/jvm/oracle_jdk7/db/bin:/usr/lib/jvm/oracle_jdk7/jre/bin  
    export JAVA_HOME=/usr/lib/jvm/oracle_jdk7  
    export DERBY_HOME=/usr/lib/jvm/oracle_jdk7/db

    Done! You are now ready to use java.