Tutorial

From ICal4j Wiki

Jump to: navigation, search

This tutorial is designed to help you get up and running with iCal4j as quickly as possible.

Contents

Download

Download the latest iCal4j release from SourceForge. You may choose to download and build the source distribution (e.g. ical4j-0.9.19-src.zip), but for most purposes the pre-built binary distribution will suffice (e.g. ical4j-0.9.19.zip).

Extract

Extract the files included in the Zip archive to a folder on your hard drive.

Build (Optional)

If you choose to download the source distribution you will need to build the library. This can be done using the Ant build script (build.xml) found in the root directory. The Ant target to package an iCal4j JAR file is called 'package'.

You may also choose to use Maven to build iCal4j using the pom.xml project descriptor also found in the root directory.

Include in your Classpath

Including iCal4j in your classpath depends on how you are developing your software. Typically an IDE such as Eclipse is used, in which case you would right-click on your Eclipse project and add the ical4j.jar to the Build Path. Note that you will also need to include all compile-time dependencies in your classpath also.

Add Import Statements to Your Classes

Add import statements in your classes to reference the appropriate net.fortuna.ical4j.* packages or the specific classes you'll be using. For example, to use the Calendar class, add:

import net.fortuna.ical4j.model.*;

or

import net.fortuna.ical4j.model.Calendar;

Ready to go!

You should now be ready to start working with iCal4j.