Compiling JRuby
The jruby.jar package, on which the earlier Logstash version depends, does not support AArch64. As a result, the error message "Unsupported platform: unknown-linux" will be displayed when Logstash is started.
- Download the source code and decompress it.
1 2
wget https://github.com/jruby/jruby/archive/1.7.27.tar.gz -O jruby-1.7.27.tar.gz tar -zxvf jruby-1.7.27.tar.gz
- Go to the directory decompressed.
1cd jruby-1.7.27
- Modify the source code core/src/main/java/org/jruby/ext/ffi/Platform.java.
- Open the source code file.
1vi core/src/main/java/org/jruby/ext/ffi/Platform.java - Press i to enter the insert mode and modify the file.
- Add AARCH64 to line 87.

- Add the AARCH64 branch to lines 149 and 150.

- Add the AARCH64 branch to line 209.

- Add AARCH64 to line 87.
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open the source code file.
- Modify the pom.xml file.
- Open the file.
1vi pom.xml - Press i to enter the insert mode. In line 71, change the jffi version from 1.2.12 to 1.2.13 (jffi 1.2.13 supports AArch64).
1<jffi.version>1.2.13</jffi.version>

- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open the file.
- Modify the core/pom.xml file.
- Open the file.
1vi core/pom.xml - Press i to enter the insert mode. In line 101, change the jnr-ffi version from 2.0.9 to 2.1.0.
1 2
<artifactId>jnr-ffi</artifactId> <version>2.1.0</version>

- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open the file.
- Perform the compilation.
1mvn packageThe operation is successful if information similar to the following is displayed:

The compiled jruby.jar file is in the lib directory.

- Use the Kunpeng Porting Advisor to scan jruby.jar.
Parent topic: JRuby Porting Guide (CentOS 7.6)