Info on JMRI:
Development tools
Structure
Techniques and Standards
How To
Functional Info
Background Info

JMRI: Building with NetBeans

Introduction

NetBeans 7.0 (available at www.netbeans.org) makes a great platform for working with JMRI. The JMRI code is setup to work with NetBeans with almost no additional setup. (The description below is accurate for the Windows version of NetBeans 7.0. NetBeans is supposed to be identical across platforms, but this hasn't been checked on anything else).

NetBeans is a very powerful Integrated Development Environment (IDE), which can make working with the JMRI code pretty easy. But it takes a little getting used to, and reading the tutorials on the NetBeans 7.0 web site will be helpful.

Getting and Installing NetBeans

Many Linux distributions have NetBeans available in their software repositories - search your package manager for NetBeans.

Checking out code

The easiest way to get the initial copy of the code is to directly check it out using NetBeans' integrated SVN. Once you've done that, NetBeans will automatically use it.

Start NetBeans and do the following steps. Text in brackets [] are menu items to be selected or buttons to be pressed. Text in this font should be typed into NetBeans exactly as written. This font denotes explanations and stage directions to follow.

[Team]->[Subversion]->[Checkout]
[Window]->[Output]->[Output] shows SVN activity log window...

Building and running JMRI

To build and run DecoderPro, all you have to do is select "Run Project (JMRI)" from the Run menu, or click the Run icon in the tool bar.

If you want to run the program under the NetBeans debugger, first set JMRI to be the Main project via [Run]->[Set Main Project]->[JMRI] then select "Debug Main Project" from the "Debug" menu.

Updating the code from SVN

From time to time, you can update the code to match the current repository contents. To do this, use the [Team]->[Update] menu choice.

Making a Jar File

Most of the code in a normal JMRI installation lives in a file called jmri.jar. If you want to replace this with your updated version, you need to create a new jmri.jar file from your modified code.

To do this, ctrl-click (or right-click) on the name of the "JMRI" project in the "Projects" window. This will open a pop-up menu, on which you'll find "Make Jar File". Select that, and a new jmri.jar file will be produced in the project's main directory.

Making a Patch File

A "diff patch file" is an easy way to gather up all your changes, even if they span multiple files, into one file that you can then send to us. It's also easy to merge in with the rest of the code, so we greatly prefer that you use this.

To create the file: