Follow the descritpions outlined here: Upgrading to Java 16 from the MineOS Turnkey ISO
just adapt it to mirror the java versions you need. The later releases of MineOS (remember to update after install if you use an ISO) also supports adjusting what java version each minecraf server runs.