如何在Java中包含一个库,该库在C 中具有Java中具有本机绑定(库)的库

How to include a library in Java which in C++ with having native binding in Java (librets)?

本文关键字:Java 绑定 本机 的库 包含一      更新时间:2023-10-16

我被困在导入最初用C 编写的库,但对Java具有本机绑定。这是图书馆https://github.com/nationalassociationofrealtors/librets,我能够通过doc/build中的DOC构建它,但是此后呢?我在project/build/中看到了一些makefiles,我想在Java中导入此库。任何帮助都将不胜感激,因为我在文档中找不到任何东西,我所知道的是有一些makefiles,并且说明该库具有对其他语言的本机绑定。

仔细观察./configure的输出,并确保配置构建以创建SWIG组件(即Java。)

Option summary:
Use ccache .................: no
Use dependency checking ....: no
Use -fPIC...................: yes
Use shared dependencies.....: yes
Compile type................: Normal
Compile examples............: no
Compile SQL compiler........: no
Compile SWIG bindings.......: no <-------- should say yes
  With DotNet...............: no
  With Java.................: no <--------- me too
  With PERL.................: no
  With PHP..................: no
  With Python 2.............: no
  With Python 3.............: no
  With Ruby.................: no
  With Node.js..............: no
Enable Maintainer Docs......: no

我尝试了它,并且需要使用相当最近的版本的SWIG - 比我的包装经理更新。没有这些,Swig绑定就不会建造,也没有Java。

但是,一旦您 do 获得该构建,它应该是一个相当简单的努力,即与任何其他Java项目一样,将呼叫到jar文件中。谁知道,构建甚至可能会为您生成Javadoc,因此您对此有所了解。