JMRI/RXTX Serial Support for Fedora

JMRI/RXTX Serial Support for Fedora

JMRI on Linux requires the rxtx package to implement the serial port communications interface. This package has a history of being interesting to install. Binaries have often been provided, but they often lagged the main code stream, as well as having compatibility issues.

So I decided to build from source. The RXTX code has forked, with one version supporting the javax.comm namespace, which requires the Sun comm.jar file. The other branch of the fork completely replaces the Sun code, but does so in the gnu.io.* namespace, which would require changes throughout the JMRI code.

First, I found that the latest version of rxtx works. Earlier releases, including the 7pre1 release, would crash or hang when run under current JVM's (1.4.2 or 1.5).

Prerequisites for installation

RXTX requires a Java SDK to be installed, and requires that your $PATH includes the SDK. If you don't have Java installed, download it from Sun. Both versions 1.4.2_06 and 1.5.0_01 are known to work with the JMRI software.

Next, download the Javacomm package from Sun. The general Javacomm download page is located at http://java.sun.com/products/javacomm/downloads/index.html, while a Solaris specific download should also be available. You need the Solaris version of this download, even though you'll be running this on Linux.

This will result in a downloaded file javax_comm-2_0_3-solsparc.tar.Z. We need the comm.jar file from this package.

$ tar zxf javax_comm-2_0_3-solsparc.tar.Z commapi/comm.jar $ sudo cp commapi/comm..jar /usr/java/jdk1.5.0_01/jre/lib/ext/comm.jar

Substitute your JDK path for /usr/java/jdk1.5.0_01 as needed.

Compiling from source

You'll need to install the RXTX code one for each JDK that you have installed and wish to use.

Compiling this package isn't that hard, but if you're not into compilation, I've provided some binaries below. Please ensure that your JAVA_HOME environment variable points to your JDK, and that $JAVA_HOME/bin is part of your PATH.

$ export JAVA_HOME=/usr/java/jdk1.5.0_01
$ PATH=$JAVA_HOME/bin:$PATH
$ tar zxf rxtx-2.0-7pre2.tar.gz
$ cd rxtx-2.0-7pre2
$ ./configure
$ make
$ sudo make install
    

Installing from binary RPM's

The rxtx RPMS below are the binary & source packages. They're suitable for any machine with the appropriate JDK's installed. That's what I've got, and I haven't tried to make it any fancier. But installation should be very simple:

For users of JDK 1.5.0_01

# rpm -Uvh http://stpaulterminal.org/software/jmri/jdk1.5.0_01/rxtx-2.0-7pre2.2.i386.rpm

or for JDK 1.4.2_06

# rpm -Uvh http://stpaulterminal.org/software/jmri/j2sdk1.4.2_06/rxtx-2.0-7pre2.2.i386.rpm

If you don't have the right Java SDK installed, you can download the RPM files and then extract the binaries by running:

$ rpm2cpio rxtx-2.0-7pre2.2.i386.rpm | cpio -ivd

and then copying the files from ./usr/java/whatever/jre/lib/ to the right places for your installed JDK.

These RPMS were compiled on Fedora Core 3. I don't have any other Linux distros installed, so I obviously can't test them. There is C++ code in this package, so G++ ABI issues may come up. If you're not sure, or if you run into problems, you should try rebuilding this package from source. This is also useful if your JDK is installed someplace other than the Sun provided location.

$ rpmbuild --define 'JAVA_HOME /path/to/your/jdk' --rebuild http://stpaulterminal.org/software/jmri/rxtx-2.0-7pre2.2.src.rpm

Support

I'll be supporting this software again, to some extent, because I am once again using this software. So I'll be updating it as needed to match new JDK releases, or other problems. I'm not an rxtx maintainer, so bugs in that code should be reported via their web site. I just package the code and distribute the RPM's.

[ICO]NameLast modifiedSizeDescription

[PARENTDIR]Parent Directory  -  
[DIR]j2sdk1.4.2_06/2005-01-18 16:31 -  
[DIR]jdk1.5.0_01/2005-01-18 16:31 -  
[DIR]unsupported/2005-01-18 16:15 -  
[TXT]HEADER.html2005-01-18 17:11 5.4K 
[TXT]lantronix.html2004-09-29 19:46 7.3K 
[   ]serproxy-0.1.2-2.i386.rpm2004-05-22 02:29 15K 
[   ]serproxy-0.1.2-1.i386.rpm2004-05-22 02:29 15K 
[   ]serproxy-0.1.2-2.src.rpm2004-05-22 02:29 25K 
[   ]serproxy-0.1.2-1.src.rpm2004-05-22 02:29 25K 
[   ]rxtx-2.0-7pre2.2.src.rpm2005-01-18 16:30 622K 
[   ]rxtx-2.0-7pre2.1.src.rpm2005-01-18 16:14 622K 

Apache/2.4.41 (Ubuntu) Server at StPaulTerminal.org Port 443