android - 如何加载 libandroid_runtime

标签 android shared-libraries

我正在开发一个编译成 JAR 然后使用 javaws 部署的项目。在我的一个类(class)中,我需要加载设备上目录/system/lib/中的 libandroid_runtime.so。

我该怎么做?

System.load("libandroid_runtime")抛出 java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: libandroid_runtime

System.loadLibrary("/system/lib/libandroid_runtime.so") 抛出 java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library:/system/lib/libandroid_runtime.so.

System.loadLibrary("android_runtime");抛出 java.lang.UnsatisfiedLinkError: java.library.path 中没有 android_runtime

谢谢!

最佳答案

I'm working on a project that gets compiled into a JAR and then deployed using javaws

Android 不使用 Java Web Start。

In one of my classes, I need to load the libandroid_runtime.so found in directory /system/lib/ on the device.

那是不可能的。您没有对 /system 的读取权限。

关于android - 如何加载 libandroid_runtime,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9220984/

相关文章:

c++ - 有没有办法在不加载的情况下读取 .so 文件的内容?

c++ - 如何加载 Apache2 模块的依赖项(外部库)?

android - 手机的移动导致代码出现意外结果

java - 在 Android 应用程序中嵌入网页

android - 在 Android 中获取没有位置服务的可用 WiFi 网络列表

java - adapter.getItem() 将返回什么?

c - libsgx_capable.so : cannot open shared object file: No such file or directory

android - GridView 的项目之间的空间

linux - 设置 WSGI 应用程序时的 PCRE 问题

ios - 使用 CoCoapods 添加 2 个平台的库