1.
Deutsche Bundesbank /JD+ /
Quick Start Guide Developer /
Thomas Witthohn, Christiane Hofer, Dominique Ladiray, Jean Palate /
9/4/2017 /
Introduction
This Quick Start Guide has been written for people who know nothing about Java, NetBeans, Maven etc. but want to contribute to the JDemetra+ project and dream of improving or completing the code and developing new plug-ins.
From now, we will just suppose a few things:
- You are a pretty good statistician[1] with a good practice of time series analysis, seasonal adjustment and JDemetra+.
- You have your own personal computer[2] and you can use it, install a new program, write some notes, use Excel or even a real statistical software etc.
Installing the Toolbox
If you use JDemetra+ 2.2.0, a Java application, on your computer, you already have installed the JRE (Java Runtime Environment), software that contains everything required to run Java applications on your system
But if you want to develop plug-ins or modify JDemetra+ code, you need some more tools:
- JDK (1.8 or higher)
JDK (Java Development Kit) includes a complete JRE (Java Runtime Environment) plus tools for developing, debugging, and monitoring Java applications.
- NetBeans IDE (8.1 or higher)
NetBeans IDE (Integrated Development Environment) is a powerful integrated development environment for developing applications on the Java platform.
You might use another IDE but, as JDemetra+ is based on NetBeans for the graphical interface, this IDE is the more natural one and the highly recommended one to avoid problems.
And, as you plan to modify/complete the JDemetra+ code, you need it.
The last versions of the 2 software can be downloaded from the following link:
If you click on the NetBeans icon, and after accepting the License Agreement, you are ready to download the versions corresponding to your operating system (Windows, MAC OS or Linux).
When the download is completed, you can install JDK and NetBeans on your computer.
- JDemetra+ source code
JDemetra+ is split into two main parts. The first one (jdemetra-core) contains the core routines and some peripheral modules, without any graphical components. It is completely independent of NetBeans. The second one (jdemetra-app) contains the graphical interface, and is based on the NetBeans Platform.
The last version of the code can be found on GitHub, at the following link:
Note:
Using the "Download Zip" icon, gives you the last development code. The "production code" can be downloaded from the following links:
Exercise 1: Building JDemetra+ from scratch
For the whole procedure make sure to have an unrestricted internet connection.
We are ready now for our first, but important, exercise: compiling JDemetra+. In fact, you do not need to compile JDemetra+ to create new plug-ins but it will be compulsory if you want to contribute to the code itself, test new moving averages, change the output etc.
Step 1: Open NetBeans
The previous installation process likely created a NetBeans icon on your desktop. Double click on it to open NetBeans.
Step 2: Click Team -> Git -> Clone…
Step 3: Specify the URL
As Repository URL choose and specify the destination folder.
Step 4: Choose the remote branch
Select all branches. The most recent branch should be the develop-branch and it is mandatory for further development. Additionally it contains all changes and fixes since the last release. We will focus on branch release-2.2.0 during the course.
Step 5: Confirm the destination
For the later steps it is important to have “Scan for NetBeans Projects after Clone” checked and select the Checkout branch “release-2.2.0”.
The other settings should be fine.
Step 6: Open the project
Click “Open Project…”
Select JDemetra+ and click “Open”.
NetBeans should now look similar to this:
Step 7: Right-Click JDemetra+ and press “Build”
Step 8: Wait for the Build to finish
Step 9: Click Team -> Remote -> Clone…
Now repeat the steps 3 to 8 for the URL
Exercise 1bis: Another way to build JDemetra+ from scratch
The two parts, jdemetra-core and jdemetra-app, must be downloaded and unzipped in the folder we are going to use for your experiments, let us say MyOwnJD+.
Step 0: Download the source-code
Download jdemetra-core (Click on "jdemetra-core" select the branch “release -2.2.0” and Clone or Download choose "Download ZIP" icon)
Download jdemetra-app (Click on "jdemetra-app" select the branch “release -2.2.0” and Clone or Download choose "Download ZIP" icon)
The two parts, jdemetra-core-release-2.2.0 and jdemetra-app-release-2.2.0, must be downloaded and unzipped in the folder we are going to use for your experiments, let us say MyOwnJD+
Step 1: Open NetBeans
See Exercise 1 Step 1
Step 2: Open the jdemetra-core-release-2.2.0 project
Close the "Start Page" and, using the menu File > Open Project, you can now open thejdemetra-core-release-2.2.0 project located in the MyOwnJD+ folder.
An important warning: you have to start with this project which is independent of NetBeans because, during the previous installation, all the necessary files have not yet been created. If you do not do so, and load the jdemetra-app-release-2.2.0project or both of them, you will see an unpleasant and disturbing (but not so serious) pop-up telling you that some resources are missing (see hereafter).
NetBeans loads the project and, in the "Projects" window, appears a JDemetra+ "hierarchy".
Step 3: Build JDemetra+
You can now "build" (compile) the JDemetra+ project, through the menu Run > Build project (JDemetra+).
An important warning: During this process be sure that you have access to internet as NetBeans is going to download some important and necessary resources (the missing "dependencies") that will complete the installation of the software.
The Output window gives you some indications on the process and its results.
The compiled code, and therefore the Cruncher, can now be found in the directory
.....\MyOwnJD+\jdemetra-core-release-2.2.0\jwsacruncher\target\appassembler\
Step 4: Open the jdemetra-app-release-2.2.0 project and build NbDemetra
You can now apply the same process to the jdemetra-app-release-2.2.0 project. As you still do not have all the files necessary to this project, when you open it (File > Open Project), it is likely you see this kind of warning:
Do not panic!! Close the "Open Project" window and build the project as nothing happened. The missing resources will be downloaded and the program should be properly compiled.
At the end of the process, a "NbDemetra - Parent" hierarchy will appear in the "Projects" window.
You can launch JDemetra+ double-clicking on the "NbDemetra" module[3].
You can also find the compiled program in the following zip file:
.....\ MyOwnJD+\jdemetra-app-release-2.2.0\nbdemetra-app\target\nbdemetra-app-2.2.0.zip
Quick Start Guide For JD+ Dev.docx
[1]This should be very useful if you want to contribute to JDemetra+
[2]Life appears to be simpler and easier without IT Departments and security restrictions.
[3] Or select this open module and press the green button