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
apt install python3-pip
python3 -m pip install gdown
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 need to reinstall easy-java script and install Java version again.