1.21 only up for a few seconds

I wanted to try 1.21 with some friends but all 1.21 servers stay up for just a few seconds and then close. Even 1.20.4 server that I have switched to 1.21 don’t work but when I switch it back it works fine.
Does anyone have the same problem or a solution?

What are you seeing in the logs/latest.log section?

it is probably because versions past 1.20.4 needs to have java 21 to run. so you will have to update java.
This is how i updated it