Compiling jna-3.0.9, 4.1.0.jar
Installing Ant-1.10.8
- Download and decompress the Ant 1.10.8 installation package.
1 2
wget https://archive.apache.org/dist/ant/binaries/apache-ant-1.10.8-bin.tar.gz tar -zxvf apache-ant-1.10.8-bin.tar.gz -C /opt/tools/installed/
- Set the Ant environment variables.
- Open the /etc/profile file.
1vi /etc/profile - Press i to enter the insert mode and add the following content to the end of the file:
1 2
export ANT_HOME=/opt/tools/installed/apache-ant-1.10.8 export PATH=$ANT_HOME/bin:$PATH
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open the /etc/profile file.
- Make the environment variables take effect.
1source /etc/profile
- Check the Ant version.
1ant -version
Compiling Jna 3.0.9
- Download the Jna 3.0.9 source code and decompress it.
1wget https://github.com/java-native-access/jna/archive/3.0.9.tar.gz - Decompress the source code package.
1tar -zxf 3.0.9.tar.gz
- The libffi version corresponding to Jna 3.0.9 does not support AArch64. Download the libffi-3.2.1 source code and replace the jna-3.0.9/jnalib/native/libffi directory.
1 2 3 4
wget https://gcc.gnu.org/pub/libffi/libffi-3.2.1.tar.gz tar -zxf libffi-3.2.1.tar.gz rm -rf jna-3.0.9/jnalib/native/libffi/* cp -r libffi-3.2.1/* jna-3.0.9/jnalib/native/libffi/
- Go to the jna-3.0.9/jnalib directory.
1cd jna-3.0.9/jnalib
- Perform compilation.
1ant
After the compilation is complete, the jna.jar file is generated in the jna-3.0.9/jnalib/build-d64 directory.
Compiling Jna 4.1.0
- Download the Jna 4.1.0 source code and decompress it.
1wget https://github.com/java-native-access/jna/archive/4.1.0.tar.gz - Decompress the source code package.
1tar -zxf 4.1.0.tar.gz
- Go to the jna-4.1.0 directory.
1cd jna-4.1.0
- Perform compilation.
1ant
After the compilation is complete, the jna.jar file is generated in the build directory.
Parent topic: JNA Porting Guide (CentOS&openEuler)