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

JMRI: Building with NetBeans

NetBeans 5.5 (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 MacOS X version of NetBeans 5.5. 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 web site will be helpful.

Checking out code

The easiest way to get the initial copy of the code is to directly check it out from CVS. Once you've done that, it's easy to get NetBeans to use it. We provide brief instructions here, but if you want to know more about CVS or get a copy of it for your computer, please see our
"getting the code via CVS" page.

You can download the most recent source code via CVS using:

cvs -d:pserver:anonymous@jmri.cvs.sourceforge.net:/cvsroot/jmri login
cvs -d:pserver:anonymous@jmri.cvs.sourceforge.net:/cvsroot/jmri co all 
(If asked for a password, just hit return)

This will create a number of subdirectories, including one named "java" that we'll reference below.

If you have an existing copy of the code and want to update it to the most recent contents of CVS, the second command is:

cvs -d:pserver:anonymous@jmri.cvs.sourceforge.net:/cvsroot/jmri -q update -dA

The first time you build JMRI with NetBeans, you have to tell it how to find the "JMRI Project", which contains the code. After that, you can just reopen the project from the "Open Recent Projects" list in the File menu, or the list of projects in the Projects window pane.

The project is now open and available for use.

Building and Running JMRI

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

If you want to run the program under the NetBeans debugger, select "Debug Main Project" from the "Run" menu.

Updating the code from CVS

From time to time, you can update the code to match the current repository contents. To do this, select the "Update All Files" from the CVS menu.

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 "java" project in the "Navigator" 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: