Make a server run a specific version of Java

I’m trying to install a 1.12.2 server. But from my understanding, the java version needs to be version 8. I’ve installed version 8 but it’s still running the server with the most recent. So the server won’t start when I try and boot it. Is there something I can add to JAR arguments or something. I’m using Truenas if that’s any help.