Updating to Java 17
Java 17 minimum requirement
Grim now requires a minimum of Java 17 in order to run & will not offer Java 8 compatibility builds. This aligns with ViaVersion 5.0.0+ requiring Java 17.
See paper's documentation here on how to update your Java version.
Regards to Minecraft 1.8
Even Minecraft 1.8 is able to run on Java 17. At this point you should be using an actively maintained 1.8 Paper fork, which should support Java 17.
You might even experience strange bugs or false positives when running stock 1.8 Paper because of how outdated the Netty version in that release is.
Other versions
Some older versions require the startup flag -DPaper.IgnoreJavaVersion=true to work but most server versions run perfectly fine using Java 17.