All versions
Java 25
Minecraft 26.1.2 was released on 2026-04-09. Mojang's version file lists Java 25 for it, for both the game and a server.
See which Java you have:
java -version
Download Java 25 from Adoptium