Rate This Document
Findability
Accuracy
Completeness
Readability

Compiling jna-3.0.9, 4.1.0.jar

Installing Ant-1.10.8

  1. 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/
    
  2. Set the Ant environment variables.
    1. Open the /etc/profile file.
      1
      vi /etc/profile
      
    2. 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
      
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  3. Make the environment variables take effect.
    1
    source /etc/profile
    
  4. Check the Ant version.
    1
    ant -version
    

Compiling Jna 3.0.9

  1. Download the Jna 3.0.9 source code and decompress it.
    1
    wget https://github.com/java-native-access/jna/archive/3.0.9.tar.gz
    
  2. Decompress the source code package.
    1
    tar -zxf 3.0.9.tar.gz
    
  3. 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/
    
  4. Go to the jna-3.0.9/jnalib directory.
    1
    cd jna-3.0.9/jnalib
    
  5. Perform compilation.
    1
    ant
    

    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

  1. Download the Jna 4.1.0 source code and decompress it.
    1
    wget https://github.com/java-native-access/jna/archive/4.1.0.tar.gz
    
  2. Decompress the source code package.
    1
    tar -zxf 4.1.0.tar.gz
    
  3. Go to the jna-4.1.0 directory.
    1
    cd jna-4.1.0
    
  4. Perform compilation.
    1
    ant
    

    After the compilation is complete, the jna.jar file is generated in the build directory.