What do I need to change in startup.bat (5.2) for Java 9?

I installed Java 9 so the CurrentVersion in the registry now says 9. I’m guessing that is what is screwing up the first part of startup.bat. Any workarounds that don’t involve uninstalling 9?

You don’t need to uninstall Java 9, but you do need to configure Lucee not to use it until Java 9 is officially supported.

I couldn’t find a general ticket for Java 9 support in Lucee so I created this one: