Hi im trying to read com port, so I add library to my java directory like they wrote here but when Im witing simple code like
import java.util.Enumeration;
import javax.comm.*;
public class CompotCore {
public static void main(String[] args)
{
Enumeration list = CommPortIdentifier.getPortIdentifiers();
}
}
I get such error:
java.lang.UnsatisfiedLinkError: no Serial in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1681)
at java.lang.Runtime.loadLibrary0(Runtime.java:840)
at java.lang.System.loadLibrary(System.java:1047)
at gnu.io.RXTXCommDriver.<clinit>(RXTXCommDriver.java)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237)
at javax.comm.CommPortIdentifier.<clinit>(CommPortIdentifier.java:109)
at CompotCore.main(CompotCore.java:11)
Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z
at com.sun.comm.SunrayInfo.isSessionActive(Native Method)
at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155)
at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100)
at javax.comm.CommPortIdentifier.<clinit>(CommPortIdentifier.java:138)
at CompotCore.main(CompotCore.java:11)
i read that I had to add System.load("Serial");
with full path but I dont have such library and dont know where to find it.