使用的技术
- 使用开源项目Javacpp
- 项目地址 https://github.com/bytedeco/javacpp
环境配置
- Centos8
- OracleJDK+环境变量。jdk下载链接 https://www.oracle.com/technetwork/java/javase/downloads/index.html
- gcc编译工具,dnf install man-pages 或者 yum install man-pages,输入 gcc -version 出现版本信息即可
使用
- NativeLibrary.h 中的 C++代码
#include <string>
#include <iostream>
using namespace std;
namespace NativeLibrary {
class NativeClass {
public:
const std::string& get_property() {
return property; }
void set_property(