Damir
Damir

Reputation: 56199

NoSuchPortException problem for serial port

I tried to connect to SerialPort COM6 using (Windows XP) javax.comm library with this piece of code

portId = CommPortIdentifier.getPortIdentifier(commName);
        port = portId.open("", Integer.parseInt(timeout));
        serialPort = (SerialPort) port;
        serialPort.setSerialPortParams(Integer.parseInt(baudRate), SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);

but I got exception NoSuchPortException and error

Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path
Caught java.lang.UnsatisfiedLinkError: com.sun.comm.SolarisDriver.readRegistrySerial(Ljava/util/Vector;Ljava/lang/String;)I while loading driver com.sun.comm.SolarisDriver
Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path

What is wrong with this ? Can anybody please help ?

Upvotes: 0

Views: 615

Answers (2)

JohnH
JohnH

Reputation: 150

you need to use rxtx libraries for windows.

http://rxtx.qbang.org/wiki/index.php/FAQ

Upvotes: 0

lobster1234
lobster1234

Reputation: 7779

The implementation of this API is not available on all platforms.

Upvotes: 2

Related Questions