JMRI Install Guide: Linux
This page describes general aspects of installing JMRI on Linux.There are multiple versions of Linux, all slightly different and requiring installation instructions that differ in detail. There are specific pages describing details of installation on
JMRI users have created helpful pages:- Instructions for Fedora on david zuhn's pages and Jon Miner's pages.
- Instructions for Debian on Tom Jerrard's web site, including a great description of how to add an icon to the desktop.
You can also find some more specific information on the "JMRI Linux FAQ page".
The general procedure to install JMRI is:
- Determine if your hardware supports Java and JMRI
- Get and Install Java (if needed)
- Download the Java 1.4 "Linux Red Hat RPM shell script" from
http://java.sun.com/j2se/.
This should give you a file named "j2re-1_4_0-fcs-linux-i386.rpm".
Install that with:
rpm -i j2re-1_4_0-fcs-linux-i386.rpm - Download and Install the Java Communications API
If you are installing JMRI 2.9.1 or earlier, you need to install a Java Communications API (Java comm) library. If you are installing JMRI 2.9.2 or later, skip this step.
- Download and install javacomm20-x86 from
http://java.sun.com/products/javacomm/
and install it with
cp comm.jar /usr/java/j2re1.4.0/lib/ext/
echo Driver=gnu.io.RXTXCommDriver > /usr/java/j2re1.4.0/lib/javax.comm.properties - JavaComm on Linux requires a version of the rxtx package.
Finding and building an rxtx package that works is a bit of a
pain.
The 1.4-16pre2 version of rxtx-1.4 has worked for some people. It can be downloaded via this link
Information on how to build your own version (sometimes needed) can be found on david zuhn's web site. He has also kindly made pre-built RPMs available there.
- Give user-level application access to serial ports
chmod 666 /dev/ttyS0
chmod 666 /dev/ttyS1 - Give user access to lock files (required on Red Hat). Edit /etc/group & /etc/gshadow to add user to 'uucp' and 'lock' groups.
Note that you will have to reinstall the rxtx driver and javax.com package if you have to reinstall the system software, or if you do a "clean install" of an OS update.
- Download and install javacomm20-x86 from
http://java.sun.com/products/javacomm/
and install it with
- Get JMRI
- Install JMRI
- Installation is complete.
These steps outline how to install DecoderPro on Linux. These steps should work for Red Hat 8, 9 and 10. They don't work on RedHat 7.
(For other versions of Linux, please see the first item in our JMRI Linux FAQ).
You'll need the correct serial port or USB port to attach to your layout hardware. JMRI is compatible with USB-to-Serial adapters, so long as they have Linux drivers that make them look like regular serial ports. For troubleshooting, see the FAQ
See if you have a version of Java already installed
sh> java -version
If the version is 1.4 or later, you may be fine, but be aware that if you did not install Java on your system yourself, some systems have Java only partially installed. They will respond correctly to the above command, but still are not all there. If your system does not have Java in the environment variable PATH, the install is probably not complete. Check with the system manager or do a fresh Java installation.
If it is not at least 1.4, or if you get a "java: not found" error, you will need to install it.
Most Linux distributions can get an automated install download
from Sun by clicking on this button:
To manually install Java, the following steps need to be performed with superuser priviledges:
Download a version of JMRI, either the latest production version, or a "test version". Since the version numbers change with every release, this link takes you to the general JMRI download page, where you can select whichever version you like.
The JMRI project is continuously adding features, bug fixes, examples and tutorials to the release, and so a new "test" versions appear every couple of weeks. You may find one of these has features that you really want. These are announced in the "jmriusers" Yahoo discussion group at http://groups.yahoo.com/group/jmriusers/.
Uncompress/untar the file you downloaded above. This will create the "JMRI" folder.
To install, you just have to move the JMRI folder to where you want it on your computer.
You can run the program by using the "DecoderPro", "PanelPro", "LocoTools", or "JmriDemo" scripts in the JMRI folder. Change directory there, and invoke a script with e.g. "./DecoderPro"