我要评分
获取效率
正确性
完整性
易理解

Compiling LZ4-java

The following uses lz4-java-1.2.0.jar as an example. When compiling lz4-java-1.3.0.jar, you only need to change the version number.

Installing Ant 1.9.14

  1. Download the Ant 1.9.14 installation package from the official website.
    1
    wget https://archive.apache.org/dist/ant/binaries/apache-ant-1.9.14-bin.zip
    
  2. Decompress the installation package.
    1
    unzip apache-ant-1.9.14-bin.zip
    
  3. Install Ant to a directory (for example, /opt/tools/installed).
    1
    mv apache-ant-1.9.14 /opt/tools/installed/
    
  4. Set 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 /etc/profile file:
      1
      2
      export ANT_HOME=/opt/tools/installed/apache-ant-1.9.14
      export PATH=$ANT_HOME/bin:$PATH
      
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  5. Make the environment variables take effect.
    1
    source /etc/profile
    
  6. Check the Ant version.
    1
    ant -version
    

Compiling LZ4-java

  1. Download the source code.
    1
    wget https://github.com/lz4/lz4-java/archive/1.2.0.zip
    
  2. Decompress the source code package.
    1
    unzip 1.2.0.zip
    
  3. Go to the directory generated after the decompression.
    1
    cd lz4-java-1.2.0
    
  4. Modify the build.xml file.
    1. Open the file.
      1
      vi lz4-java-1.2.0/build.xml
      
    2. Press i to enter the insert mode and change http in line 60 to https.

    3. Change the ivy version number in line 29 to 2.5.0.

    4. Press Esc, type :wq!, and press Enter to save the file and exit.
  5. Compile LZ4-java.
    1
    2
    ant ivy-bootstrap
    ant
    

    The compiled package is in the dist folder of the root directory of compilation.

    Before compilation, ensure that the /root/.ivy2/ directory is empty.