Stopped Bitbucket Server with stop-bitbucket.sh and now can't restart it

chrismccallan April 7, 2018

Before attempting to upgrade our Bitbucket Server instance from 5.3.0 to the latest version, I ran stop.bitbucket.sh. Without making any changes I tried to run ./start-bitbucket.sh and am now getting the error

[user@bitbucketserver bin]$ ./start-bitbucket.sh
Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
Edit set-jre-home.sh and define JRE_HOME

Startup has been aborted

 

I haven't made any system/script changes. Is there any way of trouble shooting this? Thanks

4 answers

1 accepted

0 votes
Answer accepted
Niels April 7, 2018

Did you always run as ‘user’ or have you perhaps got another account that bitbucket was running as?  Use du to change to the other user and try again.

 

did you install any Linux patches, perhaps a system folder was recreated and is temporarily stale. Try bebooting your server and start again.

 

try running ‘which java’’ to check if your java variables are valid.

 

you may still want to continue the upgrade in a separate folder after creating a backup of your shared and home folders

chrismccallan April 7, 2018

Rebooting then starting as the user with ownership of the directory was the one, thanks a million!

0 votes
Jonathan Vezinat October 6, 2020

My java was updated and caused this.  Bitbucket set-jre-home.sh was pointed to the older version.  Once i pointed the script to the new version, no problems starting up.

"/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.265.b01-1.el7_9.x86_64/jre"

Just change the actual version to match what is actually on your system.  Hope this helps!

0 votes
chrismccallan April 7, 2018

Hi @Sloan N_ B_ thanks for the reply. I've went the steps in the troubleshooting guide 

$ java -version

openjdk version "1.8.0_161"

OpenJDK Runtime Environment (build 1.8.0_161-b14)

OpenJDK 64-Bit Server VM (build 25.161-b14, mixed mode)

 

echo $JAVA_HOME

/usr/lib/jvm/java-1.8.0openjdk-1.8.0.161-0.b14.el7_4.x86_64

 

My set-jre-home.sh file hasn't been changed so I'm a bit stuck unfortunately.

Deleted user April 17, 2019

Same error, but in my case i have migrated bitbucket from one aws account to another account, trying to setup and start the bitbuket

$ ./start-bitbucket.sh
The JRE_HOME environment variable is not defined correctly
This environment variable is needed to run this program
Edit set-jre-home.sh and define JRE_HOME

Startup has been aborted

0 votes
Sloan N_ B_
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.
April 7, 2018

Hi @chrismccallan

Strange if you haven't made changes.

Please follow the troubleshooting steps of this documentation page anyway:
https://confluence.atlassian.com/bitbucketserverkb/java-not-found-during-bitbucket-server-startup-779171538.html 

Cheers
Niklas

chrismccallan April 7, 2018

Hi @Niklas Becker (bitvoodoo ag) thanks for the reply. I've went the steps in the troubleshooting guide 

$ java -version

openjdk version "1.8.0_161"

OpenJDK Runtime Environment (build 1.8.0_161-b14)

OpenJDK 64-Bit Server VM (build 25.161-b14, mixed mode)

 

echo $JAVA_HOME

/usr/lib/jvm/java-1.8.0openjdk-1.8.0.161-0.b14.el7_4.x86_64

 

My set-jre-home.sh file hasn't been changed so I'm a bit stuck unfortunately.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events