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
- Download the Ant 1.9.14 installation package from the official website.
1wget https://archive.apache.org/dist/ant/binaries/apache-ant-1.9.14-bin.zip - Decompress the installation package.
1unzip apache-ant-1.9.14-bin.zip - Install Ant to a directory (for example, /opt/tools/installed).
1mv apache-ant-1.9.14 /opt/tools/installed/
- Set 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 /etc/profile file:
1 2
export ANT_HOME=/opt/tools/installed/apache-ant-1.9.14 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 LZ4-java
- Download the source code.
1wget https://github.com/lz4/lz4-java/archive/1.2.0.zip - Decompress the source code package.
1unzip 1.2.0.zip
- Go to the directory generated after the decompression.
1cd lz4-java-1.2.0
- Modify the build.xml file.
- Open the file.
1vi lz4-java-1.2.0/build.xml - Press i to enter the insert mode and change http in line 60 to https.

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

- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open the file.
- Compile LZ4-java.
1 2
ant ivy-bootstrap antThe compiled package is in the dist folder of the root directory of compilation.
Before compilation, ensure that the /root/.ivy2/ directory is empty.
Parent topic: lz4-java Porting Guide (CentOS&openEuler)