表说,在网上搜索了半天,没找到jna的编译文章。而官方的网页名又不明确,折腾了几次。后来还是发现了编译内容。
参考:
https://github.com/java-native-access/jna/blob/master/www/Contributing.md
安装依赖库
sudo apt install git ant openjdk-8-jdk make gcc # sudo apt install openjdk-11-jdk # 提示找不到 # sudo apt install autotools sudo apt install texinfo maven sudo apt install libltdl7-dev
源码下载链接:
https://github.com/java-native-access/jna
git clone https://github.com/java-native-access/jna
或者下载压缩包解压:
https://github.com/java-native-access/jna/tags
编译
export JAVA_HOME=${HOME}/tsjdk8-kylin-64 export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${JAVA_HOME}/jre/bin/lib ant dist test test-platform
可能出现的错误
error: possibly undefined macro: LT_SYS_SYMBOL_USCORE please use m4_pattern_allow_柳鲲鹏的博客-CSDN博客
build.xml:391: javac doesn‘t support the “nativeheaderdir“ attribute_柳鲲鹏的博客-CSDN博客