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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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

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

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

0 votes
bitvoodoo nick Community Leader Apr 07, 2018

Hi @Christopher McCallan

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

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.

Hi @bitvoodoo nick 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 Apr 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

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!

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

1,878 views 0 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you