引用jssc库的不满意的链接错误可运行jar [英] unsatisfied link error runnable jar referencing jssc library

查看:416
本文介绍了引用jssc库的不满意的链接错误可运行jar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在创建一个可运行的Java jar,以在beagle骨黑(运行ubuntu)上运行.

We are creating a runnable java jar to run on a beagle bone black(running ubuntu).

我们创建了一个可运行的jar,它可以在我们的mac和pc(windows)上正常运行,但不能在ubuntu系统上运行.运行时,我们不断收到以下错误消息:

We have created a runnable jar which runs fine on our mac and pc(windows) but will not run on the ubuntu system. We keep getting the following error when running:

    Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
    Caused by: java.lang.UnsatisfiedLinkError: /home/ubuntu/.jssc/linux/libjSSC-2.6_armhf.so: /home/ubuntu/.jssc/linux/libjSSC-2.6_armhf.so: cannot open shared object file: No such file or directory
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1965)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1890)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1851)
        at java.lang.Runtime.load0(Runtime.java:795)
        at java.lang.System.load(System.java:1062)
        at jssc.SerialNativeInterface.<clinit>(SerialNativeInterface.java:172)
        at jssc.SerialPort.<init>(SerialPort.java:118)
        at InputBoard.<init>(InputBoard.java:33)
        at InputBoard.main(InputBoard.java:22)
        ... 5 more

任何信息将不胜感激.就像我说的那样,这可以通过基于unix的Mac上的终端正常运行,因此似乎可以在Ubuntu上运行.我们不知道为什么它引用/home/ubuntu目录.如果您需要有关该项目的任何代码信息,请告诉我们,但我认为不会有任何关系.

Any information would be greatly appreciated. As I said this runs fine through terminal on a mac which is unix based so it seems it should work on Ubuntu. We have no idea why it is referencing the /home/ubuntu directory. Please let us know if you need any code information on the project but I would not think it would be related.

推荐答案

当我为Arm的Hard float安装了最新的JDK 8时,我解决了此问题.以前,我尝试了几件事,尝试使用版本2.6、2.7和2.8(指定为LD_LIBRARY_PATH env).变量,确保该库位于〜/.jssc/linux等目录中,以至于所有这些都无济于事,只有在我升级Java之后,它才能正常工作.

I fixed this problem when I installed the latest JDK 8 for Hard float for Arm. Previously I tried several things, I tried using versions 2.6, 2.7 and 2.8, specified LD_LIBRARY_PATH env. variable, making sure that library was in ~/.jssc/linux, etc, etc all this to no avail, only after I upgraded java, it worked flawlessly.

这篇关于引用jssc库的不满意的链接错误可运行jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆