You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
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:
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.
It appears the solution was despite Confluence coming with its own copy of OpenJDK and it running perfectly fine when starting it as an administrative user, I had to install the AdoptOpenJDK separately, then add JAVA_HOME and JRE_HOME environmental variables. I was then able to remove and re-add the service and it worked. That was an utterly nonsensical solution, but it works, so whatever...
Hi @Khiem Ngo
I haven't run Atlassian stuff on Windows in a long time for... reasons... However, thinking back, I recall there were some things that needed to be done to get it working.
I don't think it's a permission issue. Rather it feels like the service isn't seeing your JAVA_HOME variable set at the system level. A quick grep of Google suggests this is a rather surprising thing. To test it, you might toss a "echo $JAVA_HOME" in the startup scripts to see what the service is seeing.
Also, do have a look at this very good page on setting up Confluence as a Windows service. There are a lot of tips/tricks to making it go there.