First initialize the submodules:
git submodule update --init
Download the appropriate compiler from the LFI releases page: https://github.com/zyedidia/lfi/releases.
If you don't have the LFI tools installed separately, you'll want to put x86_64-lfi-clang/lfi-bin on your path. Otherwise, just put x86_64-lfi-clang/lfi-clang on your path.
The examples are currently set up to use the x86_64-lfi-clang compiler.
You'll also need to install liblfi if you don't have it already:
git clone https://github.com/zyedidia/lfi
cd lfi
meson setup build -Dliblfi-only=true
cd build
ninja
sudo meson install
cd lfi-bind
go build
git clone https://github.com/zyedidia/jdk -b lfi-jdk-21 --depth 1
cd jdk
bash configure
cd build/linux-x86_64-server-release
make JOBS=$(nproc)
This should produce jdk/bin/java.
cd hello
make run
In Hello.java you can change System.loadLibrary to use native_lfi or native_native to switch between LFI and native versions of the native library.