I recently installed a new Confluence installation on a clean Windows Server 2019 server. Confluence starts fine when I run start-confluence.bat from an admin command prompt, but it runs in the foreground. When Confluence installed, it created a service, but I cannot get that service to start, nor can I find any logs to give me direction on what went wrong. The only error I get when attempting to start the service is:
Windows could not start the Confluence<numbers> on Local Computer. For more information, review the system event log. If this is a non-Microsoft service, contact the service vendor, and refer to service-specific error code 1.
The system event log has this error:
The Confluence<numbers> service terminated with the following service-specific error:
Incorrect function.
I tried to remove and reinstall the service, but when I attempt to either install or remove the service using the service.bat, I get the error:
The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE
I have made sure that JAVA_HOME points to the copy of OpenJDK that is included in the Confluence program directory, and even tried repointing it to a copy of that same folder at c:\jre to try to eliminate the potential issue for folder paths with spaces that I found could be a potential issue.
Overall, this is felling like a permissions issue, but the network service appears to have full control over the entire Confluence folder, so I don't know what's missing.