Installing JMRI on Ubuntu GNU/Linux
These are instructions for the installation of JMRI on a Ubuntu Linux/GNU system. These have been used by a number of users successfully and should work on Ubuntu, Kubuntu, XUbuntu and Debian (The USB port has not been tested under Debian).
This draft is now in its final stage.
1 Introduction
GNU/Linux is becoming increasingly popular as a desk top operating system. This short instruction deals with installing JMRI on the Ubuntu (or similar Debian based) desktop.
1.1 The Problem
JMRI is quite easy to install on Windows, and since 2.9.3 on Ubuntu. It consists of two stages, install Java and install JMRI. Unfortunatly GNU Linux used to involve five stages and some command line work. A script was written to make the task easier and modify Java so that JMRI would run. If you are updating from a JMRI version prior to 2.9.2 then Java needs to me unmodified. A script is provided on the users group to do this.
1.2 Linux/GNU
GNU/Linux provides a viable alternative to Windows. Is it free and it is also suitable for loading onto older machines which may no longer have a viable legal OS. It is also far less resource hungry than current windows distributions and this is particularly true of Xubuntu.
1.3 Ubuntu (Debian)
Ubuntu is based on Debian and is recognised as being a very user friendly distribution. Indeed in the US Dell are going to supply computers with it pre installed.
Details on installing Ubuntu can be found below at
Ubuntu:
Follow the Path "Download" then I suggest you read up on the help page which is offered which gives advice on how to download the iso image and then create a bootable CD to install Ubuntu.
Details for installing Xubuntu have also been written.2 Notes
In the next section we describe how to install the components needed before JMRI can be run, then how to install JMRI itself. Before starting that, make sure you're machine has a working internet connection (for downloads), etc.LocoBuffer USB
If you are planning to Ubuntu 7.10 and a LocoBuffer-USB from RR-Cirkits you will need to download the patched ftdi_sio.ko file (right click and save this file) to replace the one that came with the distribution. A better option is to upgrade your system to the Ubuntu 8.04 release which includes a fix for this driver problem.3 Installation Steps
There are two steps in Installing JMRI in Linux/GNU, The are installation of Java, or the modification of an previously modified copy and installing JMRI itself.
3.1 JAVA
One must be careful which Java is loaded. 'java -version' will often show Java 1.4.2 gij, this one is not wanted. The 'Blackwood' Java Virtual Machine does not work for JMRI, as it doesn't have all the needed libraries.We recommend installing from the repositories.
System > Administration > Synaptic Package Manager
Then search for sun-java6-jre or OpenJDK-6-jre.
Once you've found it, mark it to be loaded, and click apply.
You'll probably be told that a number of other packages will
also be loaded. That's OK.
3.2 RxTx
RxTx used to be a problem requiring modifications to Java to enable JMRI to run. This is no longer required. However if you are using a version of JMRI prior to 2.9.2 then Java must be "unmodified". There is a script to do this in the Users Group Files area, or one can work back from the following.
For those who do not wish to use the new version the instructions for modifying Java are given below. If one wishes to run both then this is simply a matter of unmodifying or modyfying Java using the scripts.The problem was that the RxTx in the Ubuntu repositories would not work with JMRI! RXTX 2.1 uses a different structure than RXTX 2.0; JMRI requires the RXTX 2.0 structure. The "2.0.7pre2" is known to work well and that is what is included in the automated script which can currently be downloaded
and place it in a spare directory. Unpack it by double clicking, and then extracting (extract) the file. The script is run by opening a terminal and giving the command "./RXTXinstall"
The script will do the following:
- Checks that the correct java version is installed, then copies the RXTX files to the following directories:
- javax.comm.properties, ext/javax.comm.rxtx.properties, ext/comm.jar and ext/RXTXcomm.jar to /usr/lib/jvm/java-6-sun-??/jre/lib/ and lib/ext
- i386/* to /usr/lib/jvm/java-6-sun-???/jre/lib/i386/
- Makes a symbolic link in /i386/ so the program finds the correct RxTx (ln -s librxtxSerial-2.0.7pre2.so librxtxSerial.so).
- Alters the permission on dev/ttyS0 and ttyS1.
- Backs up /etc/group and adds the user to it.
3.3 JMRI
JMRI is downloaded in the normal manner.
Double click on the .tgz file to open the File Roller, then click extract.
JMRI will created inside a "JMRI" directory which is created inside the directory that contains the downloaded .tgz file. Umm..

When PanelPro and DecoderPro are first run the look for a hidden directory ".jmri" in the home directory. If they do not find it they create it. To see this hidden directory in the file browser select "View" and "Show Hidden Files". This directory holds the preferences. If you are experiencing difficulties with the program failing to start up, removing the relevant Config2.xml file from this directory should fix it.
3.5 The Environment
On a fresh install the environment is OK, java -version will give something like:
java version "1.6.0_15"Java(TM) SE Runtime Environment (build 1.6.0_15-b03)
Java HotSpot(TM) Client VM (build 14.1-b02, mixed mode, sharing)
or
java version "1.6.0_0"
OpenJDK Runtime Environment (IcedTea6 1.6.1) (6b16-1.6.1-3ubuntu1)
OpenJDK Client VM (build 14.0-b16, mixed mode, sharing)
However upgrading Ubuntu may creat problems for JMRI releases prior to 2.9.2 as the upgrade may now point at the "wrong" java. In this case simply run the reinstall script.
USB Ports
Currently the start up scripts work "out of the box".However some versions may need altering to get the computer to "see" a USB port by adding "-Djavax.comm.rxtx.SerialPorts=/dev/ttyUSB0" as shown below
java -noverify -Djavax.comm.rxtx.SerialPorts=/dev/ttyUSB0 -Djava.security.policy
Please see the FAQ for more details.
4 Starting JMRI
To start open a terminal and enter ./DecoderPro or double click on the icon. Remember
4.1 Errors
If you have any problems get back to the group.
- bash: ./whatever.csh: bad interpreter: No such file or directory
- Can not run the shell: Try installing csh.
- bash; ./cats.csh: Permission denied
- Try setting the icon to executable.
- Port not Found.
- See Para 3.5, but be aware that when a Java update is installed, it creates a new directory and alters the soft link to it. However all the RxTx information is left behind in the old directory. The solution is to run the install script again.
5 CATS
I have carried out limited testing on CATs with 2.9.2 and with a modified install script it runs. If you are running CATs, currently one drops the zip file into the JMRI directory, and unpacks it there. Then copy cradic.gif and put the copy into resources. I would however keep TrainStat in a seperate directory.(Rev 1.9 Sun 24 Jan 2010)