错误的ELF类:ELFCLASS64(可能的原因:架构字宽度不匹配)

时间:2017-07-05 13:12:30

标签: java serial-port ubuntu-14.04

我正在尝试在Ubuntu 14.04中运行jar for Serial Communication,这需要librxtxSerial.so位于'jdk / bin'文件夹中。我在下面提到了链接:

wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)

我尝试在'jdk / bin'中使用32位/ 64位librxtxSerial.so但是仍然遇到以下错误:

OpenJDK Server VM warning: You have loaded library /usr/lib/jni/librxtxSerial-2.2pre1.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
java.lang.UnsatisfiedLinkError: /usr/lib/jni/librxtxSerial-2.2pre1.so: /usr/lib/jni/librxtxSerial-2.2pre1.so: wrong ELF class: ELFCLASS64 (Possible cause: architecture word width mismatch) thrown while loading gnu.io.RXTXCommDriver
Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/lib/jni/librxtxSerial-2.2pre1.so: /usr/lib/jni/librxtxSerial-2.2pre1.so: wrong ELF class: ELFCLASS64 (Possible cause: architecture word width mismatch)
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1968)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1893)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1883)
        at java.lang.Runtime.loadLibrary0(Runtime.java:849)
        at java.lang.System.loadLibrary(System.java:1088)
        at gnu.io.CommPortIdentifier.<clinit>(CommPortIdentifier.java:83)
        at test.Test.main(Test.java:32)

Java版本:1.7 64位

Ubuntu OS发布:

NAME="Ubuntu"
VERSION="14.04.1 LTS, Trusty Tahr"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 14.04.1 LTS"
VERSION_ID="14.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"

当我尝试使用JAVA 1.8运行它时出现以下错误

错误:找不到或加载main clas test.Test(//我的jar名称为Test)

0 个答案:

没有答案