AVRO - Environment Setup


Apache software foundation provides Avro with various releases. You can download the required release from Apache mirrors. Let us see, how to set up the environment to work with Avro −

Downloading Avro

To download Apache Avro, proceed with the following −

  • Open the web page Apache.org. You will see the homepage of Apache Avro as shown below −

Avro Homepage
  • Click on project → releases. You will get a list of releases.

  • Select the latest release which leads you to a download link.

  • mirror.nexcess is one of the links where you can find the list of all libraries of different languages that Avro supports as shown below −

Avro Languages Supports

You can select and download the library for any of the languages provided. In this tutorial, we use Java. Hence download the jar files avro-1.7.7.jar and avro-tools-1.7.7.jar.

Avro with Eclipse

To use Avro in Eclipse environment, you need to follow the steps given below −

  • Step 1. Open eclipse.

  • Step 2. Create a project.

  • Step 3. Right-click on the project name. You will get a shortcut menu.

  • Step 4. Click on Build Path. It leads you to another shortcut menu.

  • Step 5. Click on Configure Build Path... You can see Properties window of your project as shown below −

Properties of Avro
  • Step 6. Under libraries tab, click on ADD EXternal JARs... button.

  • Step 7. Select the jar file avro-1.77.jar you have downloaded.

  • Step 8. Click on OK.

Avro with Maven

You can also get the Avro library into your project using Maven. Given below is the pom.xml file for Avro.

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="   http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">





Setting Classpath

To work with Avro in Linux environment, download the following jar files −

  • avro-1.77.jar
  • avro-tools-1.77.jar
  • log4j-api-2.0-beta9.jar
  • og4j-core-2.0.beta9.jar.

Copy these files into a folder and set the classpath to the folder, in the ./bashrc file as shown below.

#class path for Avro
export CLASSPATH=$CLASSPATH://home/Hadoop/Avro_Work/jars/*