Jira and OpenJDK

Sanuglia April 28, 2017

I've seen conflicting web pages on whether or not OpenJDK[7,8] is currently supported. Could someone please clarify whether or not it is?

More specifically, I'm trying to get a server started on a FreeBSD11 server (in a jail, if that matters) and I'm getting stopped at the error of:

Wrong JVM version! You are running with .. but JIRA requires at least 1.8 to run.

PLEASE NOTE that the check-java.sh script wasn't able to identify the version, causing the startup script to halt.

However, I *do* have openjdk installed:

openjdk version "1.8.0_121"
OpenJDK Runtime Environment (build 1.8.0_121-b13)
OpenJDK 64-Bit Server VM (build 25.121-b13, mixed mode)

So I wonder if I'm really stuck here, or if there's a way for me to get around this error.

2 answers

0 votes
argreen3 November 9, 2017

The problem is that openJDK does not print 'java version' but 'openJDK version' and the provided script does not grep for that. I assume openJDK is compatible? After I fixed the issue it seemed to work just fine.

The below is some scratch code (with some diagnostic lines left in, sorry) that fixes the issue on my machine -all I've done is truncate the search string, but I'm sure you can produce a neater and safer fix - its just to show the priniple:

 

#!/bin/sh

_EXPECTED_JAVA_VERSION="8"

#
# check for correct java version by parsing out put of java -version
# we expect first line to be in format 'java version "1.8.0_40"' and assert that minor version number will be 8 or higher
#
echo $_RUNJAVA
set -x
"$_RUNJAVA" -version
set +x

"$_RUNJAVA" -version 2>&1 | grep "version" | (
IFS=. read ignore1 version ignore2
if [ ! ${version:-0} -ge "$_EXPECTED_JAVA_VERSION" ]
then
echo "*************************************************************************************************************************************"
echo "********** Wrong JVM version! You are running with "$ignore1"."$version"."$ignore2" but JIRA requires at least 1.8 to run. **********"
echo "*************************************************************************************************************************************"
exit 1
fi
)

.... and so on...

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 29, 2017

Hmm.  Whereever you found tha pages that suggested OpenJDK is supported, I'd suggest you stop using them for help and advice because they're wrong.

Oracle Java is the only supported one.  OpenJDK can work, in some cases, but it is absolutely not supported.

Sorry, hit enter too soon:

To make it at least try to start the system with OpenJDK, you will need to amend the scripts in /bin, such that they look in the right place and perform different checks for Java.  setenv.sh and start-jira.sh are the main ones from memory.  That will get Tomcat running, but once it gets to Jira, all bets are off - it will probably appear to work for the basics, and may even work fine overall, but most add-ons will fail.

Ron Chan May 20, 2019

Hello Nick,

Has that fact changed since you wrote that? Our firm is on the path towards OpenJDK and I have not come across any definitive news of Atlassian support for that. I trust your insight so I am asking you first.

Regards,
Ron

Sam Hall
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.
June 1, 2019

Suggest an answer

Log in or Sign up to answer