You can easily install the full version of Java or even multiple versions of Java and work with them at the same time, each with a different version installed. It is only supported on arm64 and Linux systems such as: debian, ubuntu and termux.
this tool has been tested on arm64 systems such as:
apt install wget
wget https://raw.githubusercontent.com/mishakorzik/easy-java/main/easy-java
chmod +x easy-java
./easy-java
# if you're using debian or ubuntu
cd /usr/local
sudo rm -rf jdk-*
# if you're using termux
cd $PREFIX/..
rm -rf java
Here are screenshots of installing Java on debian and termux
To update Java, you just need to run the installation of the version of Java that you installed last time.