Openjdk-17 is already available in Termux Official Repository but still many of us want to install Openjdk-11 , because of many reasons.
Requirements :
- aarch64 device
Steps :
- Download JDK tarball
wget https://github.com/Lzhiyong/termux-ndk/releases/download/openjdk/openjdk-11.0.12.tar.xz
- Create new directory for jdk
mkdir $PREFIX/lib/jvm
- Extract into new created directory
tar -xf openjdk-11.0.12.tar.xz -C $PREFIX/lib/jvm
- Create a symlink with name java into $PREFIX/bin
ln -sf $PREFIX/lib/jvm/openjdk-11.0.1/bin/java $PREFIX/bin/java
Tip :
- You can create more symlinks for javac, keytool, jarsigner, etc.