How do I install Gradle in OS X?

In this post we will learn how to install Gradle in OS X. The following steps will guide our installation process to make Gradle available in our OS X machine. But before we start let’s take a look at the definition from wikipedia about Gradle.

Gradle is an open source build automation system that builds upon the concepts of Apache Ant and Apache Maven and introduces a Groovy-based domain-specific language (DSL) instead of the XML form used by Apache Maven of declaring the project configuration.

Gradle installation steps:

Download Gradle

To download visit Gradle download page. Download the complete distribution which includes binaries, sources and offline documentation. When I write this post the latest release of Gradle is version 2.10 (

Upacking Gradle and Configure Environment Variables

  • Open
  • Create a new directory sudo mkdir /usr/local/gradle.
  • Extract the downloaded Gradle distribution archive by executing sudo unzip -d /usr/local/gradle.
  • Edit .bash_profile in your home directory to add GRADLE_HOME variable with the following line export GRADLE_HOME=/usr/local/gradle/gradle-2.10
  • Also update the PATH variable to include $GRADLE_HOME/bin. If you don’t already have the PATH variable add the following line export PATH=$GRADLE_HOME/bin:$PATH
  • Run source ~/.bash_profile to executes the update version of .bash_profile. Or you can open a new to make this changes active.

Running the Installation

To test Gradle installation open the and execute gradle -v command. If your installation was correct you will see something like the following output:

$ gradle -v

Gradle 2.10

Build time:   2015-12-21 21:15:04 UTC
Build number: none
Revision:     276bdcded730f53aa8c11b479986aafa58e124a6

Groovy:       2.4.4
Ant:          Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM:          1.8.0_20 (Oracle Corporation 25.20-b23)
OS:           Mac OS X 10.11.2 x86_64

Installing and Running MongoDB in Windows 7

What is MongoDB

In this post you will see how to install and running MongoDB database server on Windows 7. What is MongoDB? MongoDB is a NoSQL database. MongoDB is a non-relational JSON document store, a document oriented database. Non-relational means that it doesn’t support the relational algebra that most often expressed in SQL like what RDBMS such as Oracle or MySQL does. The document here is not a Microsoft Word documents or such, but it is a JSON (JavaScript Object Notation) documents.

And if you don’t know what it is look like, here are some examples of JSON documents:

{"firstName" : "John", "lastName" : "Doe", "cityOfBirth" : "New York"}
{"firstName" : "Julia", "lastName" : "Roberts", "movieTitles" : ["Pretty Woman", "Nothing Hill", "Runaway Bride"]}

Other characteristics of MongoDB are: it has a dynamic schema, it doesn’t support SQL language, it doesn’t support Joins, and it doesn’t support transactional across multiple collections.


MongoDB Installation

After you know a bit of MongoDB lets get started with the installation process. Here are the step by step of the MongoDB installation.

  • Downloads Windows 64-bit MongoDB installer at When this post is written the binary file name for Windows 64-bit is mongodb-win32-x86_64-2008plus-2.6.3-signed.msi.
  • After you have finish the download the installer double click the file to start the installation wizard.

    Welcome to MongoDB Setup

    Welcome to MongoDB Setup

  • Press the Next button for the next screen and check I accept the terms in the License Agreement check box and press the Next button to continue.

    End-User License Agreement

    End-User License Agreement

  • The next step is to choose the setup type. There are three types of setup available, Typical, Custom and Complete. For now we will choose Complete. So click the Complete button to continued the installation process.

    Choose Setup Type

    Choose Setup Type

  • Press the Install button to begin installation process.

    Ready To Install MongoDB

    Ready To Install MongoDB

  • After pressing the Install button you can see the screen of MongoDB installation process. Wait until the installation is done.

    Installing MongoDB

    Installing MongoDB

  • And finally you have the MongoDB database installed. Click the Finish button to end the installation process.

    Completed MongoDB Installation

    Completed MongoDB Installation

The steps above have finalize your MongoDB installation. If you check in your C:\Program Files directory you will see the MongoDB installation directory in there. There will be a bin directory under C:\Program Files\MongoDB 2.6 Standard where all the MongoDB application files. Now you have install the database server lets run and check the database server.


Running MongoDB

For this step we will focus on two files from the bin directory of the MongoDB installation. The mongod.exe and mongo.exe. The first executable is the MongoDB database engine daemon while the second executable is the shell program to access the MongoDB.

To run the database do the following steps:

  • Create data directory. By default MongoDB look for \data\db directory in the root Drive from where you run the mongod. For example you can create C:\data\db. Or you can use the --dbpath argument to tell MongoDB where to store the data.
  • Open Command Prompt and cd to C:\Program Files\MongoDB 2.6 Standard\bin and type mongod to start the daemon.
    MongoDB mongod

    MongoDB mongod

    The screen above shows you that the MongoDB is successfully started, using the dbpath \data\db and it ready and listening for connections on the default port 27017.


Running The Shell

  • Open Command Prompt and cd to C:\Program Files\MongoDB 2.6 Standard\bin.
  • Run mongo.exe to start the shell. You’ll see a welcome message to the MongoDB shell.

    MongoDB mongo shell

    MongoDB mongo shell

  • In the shell above we run a couple of commands:
  • use peopledb command ask the MongoDB to change to the persons collections, if it doesn’t exist Mongo will create one.
  • To add document to the collections we can call db.persons.insert(); and passing the JSON document as the arguments.
  • To query the collection we can use db.persons.find().
  • If you want for instance to find Julia in the collection you can do db.persons.find({"firstName" : "Julia"})
  • To close the shell we can call quit() command.

That’s all for now, I hope this post is useful for you. In the next post I will show you how to create a simple Java application that use Mongo Java Driver to store data using Java programming into the MongoDB database. So, see you in the next post. Thank you.