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

JMRI: Building with NetBeans

NetBeans 6.8 (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 6.8. 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 6.8 web site will be helpful.

Getting and installing Netbeans

Checking out code

The easiest way to get the initial copy of the code is to directly check it out using Netbean's integrated CVS. 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]->[CVS]->[Checkout]
[Window]->[Output]->[Output] shows cvs activity log window...
wait a few minutes for the CVS checkout to complete
A popup will display asking if you want to open the project

[YES]

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, select "Debug Project (JMRI)" 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, 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:

Windows Details

When running from within Netbeans on a Windows system, if JMRI can't find
your layout connection this may be the problem.

The problem is due to a different Java Runtime Environment (JRE) being
used when run from within Netbeans as opposed to normal.

Normally, the Windows installer deals with copying the necessary
communications library files into the JRE - however, you'll need to do
this manually in this instance.

1. from C:\Program Files\Java\jre1.7.0\lib\ext < Serialio.jar>
into 'C:\Program Files\Java\jdk1.7.0\jre\lib\ext'

2. from C:\Program Files\Java\jre1.7.0\bin  and 
into 'C:\Program Files\Java\jdk1.7.0\jre\bin'