3

I've had been using JSSC Connector for serial and I got the Next Exception:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no libjssc in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1860)
at java.lang.Runtime.loadLibrary0(Runtime.java:845)
at java.lang.System.loadLibrary(System.java:1084)
at jssc.SerialNativeInterface.<clinit>(SerialNativeInterface.java:34)
at jssc.SerialPort.<init>(SerialPort.java:93)
at cl.raien.jssc.SerialExample.main(SerialExample.java:22)

The Code:

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import jssc.SerialPort;
import jssc.SerialPortException;

public class SerialExample {

static Logger log = LoggerFactory.getLogger(SerialExample.class);

/**
 * @param args the command line arguments
*/
public static void main(String[] args) {

log.info(System.getProperty("java.library.path"));

SerialPort serialPort = new SerialPort("ttyUSB0");

try {
  System.out.println("Port opened: " + serialPort.openPort());
  System.out.println("Params setted: " + serialPort.setParams(9600, 8, 1, 0));
  System.out.println("\"Hello World!!!\" successfully writen to port: " + serialPort.writeBytes("Hello World!!!".getBytes()));
  System.out.println("Port closed: " + serialPort.closePort());
 }
 catch (SerialPortException ex){
 System.out.println(ex);
 }
}

}

I'm using ubuntu 12.10 86x_64 and de jssc install the $HOME/.jssc/linux/libjSSC-0.9_x86_64.so

In Eclipse I setted in the Native Library Location of jssc.jar to point to that directory first. Then, I putted that file in the project root folder, as says scream3r.org. Finally, I changed the name of the file to libjssc and libjssc.so.

Thanks in advance!!

jacknad
  • 13,483
  • 40
  • 124
  • 194
molavec
  • 8,848
  • 1
  • 27
  • 22
  • I think that is a maven issue, but if I didn't make work out! [maven rxtx](http://dev.root1.de/projects/rxtx-rebundled/wiki) – molavec Jan 21 '13 at 00:38

1 Answers1

0

1.- Install Manually jssc.jar in maven

2.- Nothing more!! probabbly it necessary fix some issue about the natives library location in maven but in my case I haven't problem.

molavec
  • 8,848
  • 1
  • 27
  • 22