librxtx-java doesn't find serial ports after upgrade to Jaunty

Bug #367833 reported by Ardjan on 2009-04-27
This bug affects 4 people
Affects Status Importance Assigned to Milestone
rxtx (Ubuntu)

Bug Description

Binary package hint: librxtx-java

Release: Ubuntu 9.04 Jaunty Jacalope
Package version: librxtx-java 2.1.7r2-4
System: Linux EWI1308 2.6.28-11-generic #42-Ubuntu SMP Fri Apr 17 01:58:03 UTC 2009 x86_64 GNU/Linux

How it worked before the upgrade:
I connect my USB device to the USB port on which /dev/ttyACM0 is created. I run my Java application which calls "CommPortIdentifier.getPortIdentifiers()" on the class This returns an Enumeration containing a CommPortIdentifier pointing to /dev/ttyACM0 which I can use to access my serial port.

What happens after the upgrade:
I connect my USB device to the USB port on which /dev/ttyACM0 is created. I run my Java application which calls "CommPortIdentifier.getPortIdentifiers()" on the class This returns an empty Enumeration, manually getting the CommPortIdentifier by calling CommPortIdentifier.getPortIdentifier("/dev/ttyACM0") gives an

What I've tried to fix this problem:
Downgrading librxtx-java to the version from intrepid. Rebooting to the old kernel (2.6.27-11), rebooting to the old kernel with the librxtx-java version from intrepid. Unfortunately none of these things helped. It just doesn't find the serial ports anymore.

Any help would be greatly appreciated, I really need a working librxtx-java in order to program some devices on my work.

Ardjan (ardjan-zwartjes) wrote :

I have done an additional test with adding"/dev/ttyACM0" to the java command line to "help" librxtx to find my serial port. The result however was a segmentation fault (the log file is attached). A small piece of additional information: The java version I'm using is:

java version "1.6.0_13"
Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
Java HotSpot(TM) 64-Bit Server VM (build 11.3-b02, mixed mode)

I hope that helps.

Ardjan (ardjan-zwartjes) wrote :

I've just downloaded the binaries for librxtx-2.2-pre2 from and let the symlink /usr/lib/ point to the version from this release. This solves my problem (although it is a rather ugly solution). So I think this indicates that the problem is somewhere in librxtx-java. Still I think it is strange that downgrading to the old librxtx-java doesn't work, but anyway I can continue my work now. It would be nice if the ubuntu package would work though.

Tuckie (jon-tuckie) wrote :

Myself and others are having the same issues with this lib while using the arduino IDE:

Copying the new seems to fix it for the most part, but its obviously a less than ideal solution.

Jaakko Korkeaniemi (jkorkean) wrote :

I had a bit more easier problem with this package. After a fresh installation the compiler was unable to find* classes before adding /usr/share/java/RXTXcomm.jar to CLASSPATH.

christopher (gabriel-c) wrote :

Same here. LibRXTX finds my USB->serial kable that lists as /dev/ttyUSB0 but it wond find a device listed as /dev/ttyACM0.

This problem is caused by the RXTX version, not by linux or java. The solution is add a line to your code:

        System.setProperty("", "/dev/ttyACM1"); //add this line ttyACMx [0,1,2,..]
 portList = CommPortIdentifier.getPortIdentifiers();

I found other bug using the RXTXcomm.jar version 2.1.7 in ubuntu 9.10 64 bits (maybe too using other 64bits linux distros). The write to serial port works right, but the read is wrong (JAVA error 134, Problematic frame: # C [] read_byte_array+0x43).
SOLUTION: to resolv this problem download the prerelease 2.2 (, unzip, and copy the files to:

sudo cp path/rxtx-2.2pre2-bins/RXTXcomm.jar /usr/share/java/RXTXcomm.jar
sudo cp path/rxtx-2.2pre2-bins/x86_64-unknown-linux-gnu/ /usr/lib/

too add this line to your code:
System.setProperty("", "/dev/ttyACM1"); //or oher ACMx

And enjoy

Ashik Ali (ashikali-m) wrote :

Hi jose Andres Cordero and all ,

First of all I want to say thanks to you . I am using debian lenny . I spent 2 days for to make this work . Now everything is alright now .

Actually I am implementing Java SMSlib based ROR webfront . It is working well with Windows OS . Then I tried this same to Linux especially on my favorite OS Debian lenny . No problem running ROR either Windows or rails . But I was unable to install
Java smslib in Linux because it needs rxtx library for serial communication .

I was very much struggled with installing rxtx in i686 environement . Thanks for your precious information .

Now I am sure that my Project is eligible to contribute Open Source World .

Thanks a lot ,
Ashik Ali,

Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.

Jose Trigueros (j-v-trigueros) wrote :

I can confirm that adding the following line of code fixed my issue:
System.setProperty("", "/dev/ttyACM1")

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers