I tried to install a java Serial communication lib on my Raspberry PI (https://github.com/scream3r/java-simple-serial-connector), so I copied the .so file (src/java/libs/linux/libjSSC-2.8_armhf.so) to my lib path (usr/lib/jvm/java-1.11.0-openjdk-armhf/lib).
and then, when I test the lib code example :
import jssc.SerialPortList;
public class Main {
public static void main(String[] args) {
String[] portNames = SerialPortList.getPortNames();
for(int i = 0; i < portNames.length; i++){
System.out.println(portNames[i]);
}
}
}
I get many errors saying that SerialPortList is not found.
So I would like to know how to properly install the lib. errors :
javac Main.java
Main.java:1: error: package jssc does not exist
import jssc.SerialPortList;
^
./SerialPortList.java:38: error: cannot find symbol
private static SerialNativeInterface serialInterface;
^
symbol: class SerialNativeInterface
location: class SerialPortList
Main.java:6: error: cannot access SerialPortList
String[] portNames = SerialPortList.getPortNames();
^
bad source file: ./SerialPortList.java
file does not contain class SerialPortList
Please remove or make sure it appears in the correct subdirectory of the
sourcepath.
./SerialPortList.java:43: error: cannot find symbol
serialInterface = new SerialNativeInterface();
^
symbol: class SerialNativeInterface
location: class SerialPortList
./SerialPortList.java:44: error: cannot find symbol
switch (SerialNativeInterface.getOsType()) {
^
symbol: variable SerialNativeInterface
location: class SerialPortList
./SerialPortList.java:45: error: cannot find symbol
case SerialNativeInterface.OS_LINUX: {
^
symbol: variable SerialNativeInterface
location: class SerialPortList
./SerialPortList.java:50: error: cannot find symbol
case SerialNativeInterface.OS_SOLARIS: {
^
symbol: variable SerialNativeInterface
location: class SerialPortList
./SerialPortList.java:55: error: cannot find symbol
case SerialNativeInterface.OS_MAC_OS_X: {
^
symbol: variable SerialNativeInterface
location: class SerialPortList
./SerialPortList.java:60: error: cannot find symbol
case SerialNativeInterface.OS_WINDOWS: {
^
symbol: variable SerialNativeInterface
location: class SerialPortList
./SerialPortList.java:293: error: cannot find symbol
if(SerialNativeInterface.getOsType() ==
SerialNativeInterface.OS_WINDOWS){
^
symbol: variable SerialNativeInterface
location: class SerialPortList
./SerialPortList.java:293: error: cannot find symbol
if(SerialNativeInterface.getOsType() ==
SerialNativeInterface.OS_WINDOWS){
^
symbol: variable SerialNativeInterface
location: class SerialPortList
./SerialPortList.java:334: error: cannot find symbol
if(portHandle < 0 && portHandle !=
SerialNativeInterface.ERR_PORT_BUSY){
^
symbol: variable SerialNativeInterface
location: class SerialPortList
./SerialPortList.java:337: error: cannot find symbol
else if(portHandle !=
SerialNativeInterface.ERR_PORT_BUSY) {
^
symbol: variable SerialNativeInterface
location: class SerialPortList
13 errors
Thanks.