All versions
Java 17
Minecraft 1.19.1 was released on 2022-07-27. Mojang's version file lists Java 17 for it, for both the game and a server.
See which Java you have:
java -version
Download Java 17 from Adoptium