cannot open shared object file: No such file or directory

简介: cannot open shared object file: No such file or directory

今天集成声网native rtc-linux-server-sdk的时候,遇到报错:

Caused by: java.lang.UnsatisfiedLinkError: /usr/java/packages/lib/libbinding.so: libagora_rtc_sdk.so: cannot open shared object file: No such file or directory
 at java.base/jdk.internal.loader.NativeLibraries.load(Native Method) ~[na:na]
 at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:388) ~[na:na]
 at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:232) ~[na:na]
 at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:174) ~[na:na]
 at java.base/jdk.internal.loader.NativeLibraries.findFromPaths(NativeLibraries.java:315) ~[na:na]
 at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:287) 

解决方式

配置环境变量

[root@dev ~]# vim ~/.bash_profile 
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/java/packages/lib

主要是

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/java/packages/lib

这里的/usr/java/packages/lib就是放我们存放so文件的地方

[root@dev lib]# ll /usr/java/packages/lib/
总用量 36392
-rwxr-xr-x 1 root root   143088 11月 17 15:10 agora_rtm.jar
-rwxr-xr-x 1 root root    60532 11月 17 15:10 authentication-2.0.0.jar
-rwxr-xr-x 1 root root   335042 11月 17 15:10 commons-codec-1.11.jar
-rwxr-xr-x 1 root root  2510096 11月 17 15:10 hutool-all-5.8.20.jar
-rwxr-xr-x 1 root root   739728 11月 28 15:15 libagora-fdkaac.so
-rwxr-xr-x 1 root root  3472144 11月 28 15:15 libagora-ffmpeg.so
-rwxr-xr-x 1 root root 17865952 11月 28 15:15 libagora_rtc_sdk.so
-rwxr-xr-x 1 root root 10569400 11月 17 15:10 libagora_rtm_sdk.so
-rwxr-xr-x 1 root root  1556224 11月 28 15:15 libbinding.so
-rwxr-xr-x 1 root root       34 11月 17 15:10 PLACEHOLDER

然后是这个文件/etc/ld.so.conf

[root@dev lib]# vim /etc/ld.so.conf
include ld.so.conf.d/*.conf

/usr/java/packages/lib
[root@dev ldconfig

添加/usr/java/packages/lib到末尾

然后执行

[root@dev lib]# ldconfig
相关文章
|
6天前
|
Java 测试技术 数据库
hql投影查询之—— [Ljava.lang.Object; cannot be cast to cn.bdqn.guanMingSys.entity.Notice
hql投影查询之—— [Ljava.lang.Object; cannot be cast to cn.bdqn.guanMingSys.entity.Notice
11 0
|
6天前
|
关系型数据库 MySQL
mysql: error while loading shared libraries: libncurses.so.5: cannot open shared object file
mysql: error while loading shared libraries: libncurses.so.5: cannot open shared object file
32 0
|
2天前
|
缓存 Ubuntu Linux
error while loading shared libraries: libxcb-icccm.so.4: cannot open shared object file: No such file or directory 问题如何处理
【5月更文挑战第16天】error while loading shared libraries: libxcb-icccm.so.4: cannot open shared object file: No such file or directory 问题如何处理
37 0
|
7月前
|
Java
【面试题精讲】Object类的常见方法有哪些?
【面试题精讲】Object类的常见方法有哪些?
|
8月前
|
Java API 开发工具
Java之API详解之Object类的详细解析(下)
Java之API详解之Object类的详细解析(下)
40 0
|
6天前
|
C#
c# 所有类的最终基类:Object
c# 所有类的最终基类:Object
7 0
|
6天前
|
XML JSON Java
作为所有类的顶层父类,没想到Object的魔力如此之大!
在上一篇博文中我们提到了Java面向对象的四大特性,其中谈及“抽象”特性时做了一个引子,引出今天的主人公Object,作为所有类的顶级父类,Object被视为是James.Gosling的哲学思考,它高度概括了事务的自然与社会行为。
55 13
|
6天前
|
存储 Java 开发者
Java Object类
Java Object类
14 0
|
6天前
|
存储 设计模式 Python
Python中的类(Class)和对象(Object)
Python中的类(Class)和对象(Object)
34 0
|
7月前
|
Java
Java常用类--------Object类
Java常用类--------Object类