How can I use Linux shared libraries in Java?

匆匆过客 提交于 2019-11-30 14:42:13

Another wayto access libraries form java besides JNI is JNA.

I find that in many cases it's easier to use then JNI, but that's just my personal opinion.

You cannot use arbitrary .so libraries in your Java code. You can use JNI to write a wrapper around native code to access from Java.

However, be aware that doing so negates many of the advantages of using Java. Your code and deployment system now becomes quite fragile and subject to many types of bugs that cannot happen in Java. I would try quite hard to find a pure-Java solution before resorting to using native code.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!