User’s Guide

About JQuantLib

JQuantLib is a free, open-source, comprehensive framework for quantitative finance, written in 100% Java. It provides “quants” and Java application developers several mathematical and statistical tools needed for the valuation of shares, options, futures, swaps, and other financial instruments.


This document is primarily intended for Java developers with interest in Quantitative Finance in general and financial instrument valuation in particular. Experience in working under a Linux based development environment is expected - most of the examples are for Debian based Linux systems and derivatives.

What this documentation is about?

This document explains the steps required for obtaining JQuantLib and building the source from command line interface on a Linux boxes or using the excellent Eclipse IDE. You can jump directly to the section which best matches your needs.

Warning for Windows users

We recommend you avoid spaces on directory names and file names. This issue was observed so many times by users of various Java applications. Actually, it is not a problem of Java applications, but the problem is the way COMMAND.COM (the command line interpreter in Windows platforms) deals with spaces, which is very specific to Windows platforms.

Building JQuantLib

Building from command line

If you prefer to build JQuantLib under Eclipse, please jump to Building JQuantLib under Eclipse.

Installing Bazaar

Simply type the following command under Debian and variants:

$ apt-get install bzr

Installing Gradle

Please follow the steps described in the Gradle documentation.

Obtaining JQuantLib

Branch JQuantLib from Launchpad by entering the command below:

$ bzr branch lp:jquantlib

Building JQuantLib

Simply type the command below:

$ gradle test

This will build JQuantLib and run the test suite. If you find troubles, please ask for support. The first time you call the gradle command, it will download all dependencies for you. This process will take time enough for a cup coffee.

Running Samples

Simply type the command below:

$ gradle demo

This will build JQuantLib and run the sample program EquityOptions which calculates options prices employing different methods.

Generating documentation

Simply type the command below:

$ gradle javadoc

Then open the browser and visit these files sitting on your workspace, for example:

$ firefox jquantlib/build/docs/javadoc/index.html
$ firefox jquantlib-samples/build/docs/javadoc/index.html
$ firefox jquantlib-helpers/build/docs/javadoc/index.html
$ firefox jquantlib-contrib/build/docs/javadoc/index.html

Building JQuantLib under Eclipse

If you prefer building JQuantLib from the command line, please jump to Building JQuantLib from Command Line.

Installing Bazaar integration for Eclipse

Install the plugin from update site:

Installing Gradle integration for Eclipse