Running the Java Engine in Linux

This article explains how to install and use the Windward Java Engine in Linux. This tutorial specifically uses Ubuntu 12.04, but the steps should work on any Linux system with little extra effort.

After completing this tutorial you will have installed the Windward Java Engine on a Linux system, and have a working knowledge of running Java programs that use the engine.

Install the JDK

The first thing needed is a JDK (Java Development Kit) installation. This isn't too hard to come by, but depending on your distribution of Linux, this step might be slightly different.

In Ubuntu 12.04, the package is openjdk-6-jdk (or default-jdk) which can be installed with the following command:

$ sudo apt-get install openjdk-6-jdk

The Oracle JDK isn't available in the default repositories on some systems, which is why we use OpenJDK here. There are guides on the internet that show you how to get the correct PPA repositories set up to get the Oracle JDK, should you need that option.

For other systems, such as Debian, Fedora, or any other flavor of Linux, this command will be different, but it should be pretty straightforward if you are familiar with your operating systems package manager.

Download and Setup the Engine

The engine is available from the downloads page, so we'll get that:

$ wget http://windward.net/downloads/SetupWindwardReportsJava.zip


We're going to install it to /opt/windward to make things easy. In the shown command, replace marcusj with your username.

$ sudo mkdir /opt/windward

$ sudo chown marcusj /opt/windward

$ unzip SetupWindwardReportsJava.zip -d /opt/windward

Then we need to place the jar files in the correct location so Java can find them

$ sudo cp /opt/windward/jars/* /usr/share/java

And of course, tell Java where to find them. We're adding it to the /etc/environment file for future use. The export command allows us to work with it during this session.

$ sudo cp /etc/environment /etc/environment.bk

$ printf "CLASSPATH=\".:/usr/share/java/*\"\n" | sudo tee -a /etc/environment

$ export CLASSPATH=.:/usr/share/java/*

Run the Sample code

Before you can run the sample code, you have to enter your license key in WindwardReports.properties or the sample will not run! 

You can use your favorite text editor to do this.

Finally we'll run the sample code:

$ cd /opt/windward/demo/Samples/Java/CommandLine/src

$ cp ../WindwardReports.properties 

$ vi WindwardReports.properties

$ javac RunReport.java

$ java RunReport ../samples/InvoiceTemplate.docx Invoice.pdf -xml ../samples/Order.xml.


And that is it! If you were to just type java RunReport, you would see a list of command-line arguments that the sample app accepts.

You can also open up RunReport.java or RunReportXml.java in your favorite Java/text editor to extend it yourself and make your own Windward Java Engine application.

0 Comments

Add your comment

E-Mail me when someone replies to this comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.