New location as you need to update with version:
sudo apt install openjdk-17-jdk
And in code snippet new Java location will be:
/usr/lib/jvm/java-21-openjdk-amd64/bin/java
That need to change out:
/usr/lib/jvm/java-8-openjdk-i386/jre/bin/java
In the orginal fixe.