NoSuchPortException using RXTX Java library on Windows?

Posted by Steve on Stack Overflow See other posts from Stack Overflow or by Steve
Published on 2008-11-08T01:32:59Z Indexed on 2010/03/23 12:53 UTC
Read the original article Hit count: 530

Filed under:
|
|

I have followed the instructions to setup rxtx on windows from http://www.jcontrol.org/download/readme_rxtx_en.html.

What I did exactly was copy rxtxSerial.dll to "C:\Program Files\Java\jdk1.6.0_07\jre\bin" and copied RXTXcomm.jar to "C:\Program Files\Java\jdk1.6.0_07\jre\lib\ext" (my JAVA_HOME variable is set to C:\Program Files\Java\jdk1.6.0_07\jre)

I also added RXTXcomm.jar to my eclipse project.

But when I run it, it still says "NoSuchPortException"

Devel Library
=========================================
Native lib Version = RXTX-2.0-7pre1
Java lib Version   = RXTX-2.0-7pre1
java.lang.ClassCastException: gnu.io.RXTXCommDriver cannot be cast to gnu.io.CommDriver thrown while loading gnu.io.RXTXCommDriver
gnu.io.NoSuchPortException
    at gnu.io.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:218)
    at TwoWaySerialComm.connect(TwoWaySerialComm.java:20)
    at TwoWaySerialComm.main(TwoWaySerialComm.java:107)

In my java file, I tell it:

        try
        {
            (new TwoWaySerialComm()).connect("COM4");
        }

and I've also tried the Java Comm API. Both cannot recognize my serial port but I am sure I followed the instruction correctly. There files are there.

Does anybody have any idea what it could be?

© Stack Overflow or respective owner

Related posts about rxtx

Related posts about java