How to install Java 21 on Termux?

3.6k Views Asked by At

So Java 21 is already out but not even Java 20 is accessible on Termux. Is there any alternative way to use Java 21 on Termux or any IDE supported Java 21 on Android Phone?

I tried to install it on termux using the pkg install openjdk-21 but it didn't work Installing Command

Result

1

There are 1 best solutions below

1
On

To install Java 21 on Termux:

  1. Download the jdk21 tar file from the official website. (If you want it for Termux, you need to download the aarch64 version.)
  2. Extract the file with the tar -xvf command.
  3. Add the Java folder to the path.
  4. Run the Java command. (If you encounter an execution error, try it with grun java.)