求助!小弟使用的是rxtx的jar包,在官网上只找到了mips和mipsel的librxtxSerial.so文件,但是这两个文件放入${JAVA_HOME}/jre/lib/mips64el之后项目报错如下:
java.lang.UnsatisfiedLinkError: /izt/j2sdk-image/jre/lib/mips64el/librxtxSerial.so: /izt/j2sdk-image/jre/lib/mips64el/librxtxSerial.so: ELF 类不对:ELFCLASS32 (Possible cause: architecture word width mismatch) thrown while loading gnu.io.RXTXCommDriver
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.lang.UnsatisfiedLinkError: /izt/j2sdk-image/jre/lib/mips64el/librxtxSerial.so: /izt/j2sdk-image/jre/lib/mips64el/librxtxSerial.so: ELF 类不对:ELFCLASS32 (Possible cause: architecture word width mismatch)
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1934)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1838)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1124)
at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123)
at utils.SerialPortUtils.getserialport(SerialPortUtils.java:321)
at laite.Display.main(Display.java:88)
... 5 more
错误提示环境不匹配,但是在官网上找不到mips64el的文件。
求教各位大佬,在龙芯mips64el环境下java如何操作串口
库文件位数不对,你那是32位的,安装到64位系统指定报错
https://blog.csdn.net/mokeily99/article/details/127881559参考这个,或者去官网下载源码自己编译就有mips64el的库文件了