That fixed it! For anyone else having this problem you don't need to uninstall Java 9, if you have 9 and 8 installed you can specify which version of Java to run by entering the full directory in your batch file like so:
Note the quotes around the directory, they're necessary if there are any spaces (like in the folder "Program Files").
Thanks for the help!