Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Cannot start Confluence service because it claims I don't have JDK

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.

2 answers

1 accepted

0 votes
Answer accepted

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...

The built in JRE stuff only works properly with the Bundled Start and Stop batch files, for manually running the server.      Kinda sucks but what you've done is the best approach.

0 votes
Mike Rathwell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 05, 2020

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.

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events