Bitbucket service not stating after Java update

Fearghal Savage December 17, 2018

Recently updated to Java 191 however now the services for Atlassian Bitbucket and Elasticsearch won't start. I've updated the environment variables to show along with manually starting the .bat and reboot of the server 

 

Any suggestions? 

 

Thanks,

Feasrghal

1 answer

0 votes
Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 20, 2018

Hello Fearghal,

Keeping your Java up-to-date is always a good practice. Having service break when you do this can always seem like a step backwards. While updating the environment variable is a good idea, you also need to update the variable for Bitbucket itself. Please review the following to set your Bitbucket java variable.

Cause #2 - Incorrect JAVA_HOME location

Bitbucket Server was installed with automated installer which creates a file containing the expected value for the JAVA_HOME variable. This file is responsible for setting the JAVA_HOME variable for Bitbucket Server itself, and will use the file's JAVA_HOME variable if there is no environmental variable set.

The JAVA_HOME location changed overtime. The variable can be found in the following file depending on the current version:

  • 5.0.0 or newer: the JAVA_HOME variable is now JRE_HOME and is set in the <Bitbucket Server installation directory>/bin/set-jre-home.sh file
  • between 4.9.0 and 5.0.0: the JAVA_HOME variable is set in the <Bitbucket Server installation directory>/bin/set-java-home.sh file
  • between 3.8.0 and 4.9.0: the JAVA_HOME variable is set in the <Bitbucket Server installation directory>/bin/setenv.sh file

Resolution #2 - Incorrect JAVA_HOME location

Update the JAVA_HOME environmental variable or update the appropriate file depending on the installed version to reflect the new Java location. The JAVA_HOME contains bin/java. This part of the path is found automatically.

Source: java: not found during Bitbucket Server startup.

If this does not resolve the issue then we will need some log output to figure out exactly where the issue is with Java.

For the following, we ask you open a windows CMD or Powershell windows. Can you please let us know the output of: JAVA_HOME

When you manually started Bitbucket, was there are error displayed? Can you please review the Windows Event log to see if any errors are present for Bitbucket?

Can you please review the Bitbucket logs and let us know if any errors present? You can find the log location with: Bitbucket Server home directory

Please let us know if you were able to resolve the issue by adjusting the variable path, if not then please provide the requested information from the logs.

Regards,
Stephen Sifers

Fearghal Savage December 30, 2018

Hi Stephen, 

 

Many thanks for your help with this! Was able to resolve the issue by updating the JAVA_HOME and the reg, bit strange that the reg needed updating but was still pointing to the old version. 

 

Best Regards,

Fearghal

Like Stephen Sifers likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events