0

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 ?

Damir
  • 54,277
  • 94
  • 246
  • 365

2 Answers2

2

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

lobster1234
  • 7,679
  • 26
  • 30
0

you need to use rxtx libraries for windows.

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

JohnH
  • 150
  • 1
  • 11