This article was a lifesaver for me when trying to upgrade the Java version for my kid's Minecraft server. Seems the latest Minecraft Server 1.17.1, requires Java 16 which requires a little finagling on my Ubuntu VM.
All credit goes to https://docs.azul.com/core/zulu-openjdk/install/debian