Watch the video:
Timestamps:
0:00 - Explanation
0:28 - Why do I get the JNI error?
0:49 - Downloading Java 16
1:23 - 1.17+ Server
1:45 - Uninstalling old Java versions
Trying to host a Minecraft server, and getting an annoying Java error saying something about JNI? Well, this video shows you all you need to know about fixing it quickly. By the end, you’ll be able to get back to hosting and playing with your friends in no time! You don’t even need to restart your computer to fix this issue.
Download Java 16: https://www.oracle.com/java/technologies/javase-jdk16-downloads.html