Jira installation fails in a Docker container with Error: Could not create the Java Virtual Machine
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
While installing Jira from Archive File inside a Docker container created from quay.io/centos/centos:stream8 image, Jira installation fails with Error: Could not create the Java Virtual Machine.
Diagnosis
Start Jira from ./start-jira.sh and following message is logged in the terminal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
[root@02db19e54355 bin]# ./start-jira.sh
To run Jira in the foreground, start the server with start-jira.sh -fg
executing as current user
`sMMMMMMMMMMMMMM+
MMMMMMMMMMMMMM
:sdMMMMMMMMMMM
MMMMMM
`sMMMMMMMMMMMMMM+ MMMMMM
MMMMMMMMMMMMMM +MMMMM
:sMMMMMMMMMMM MMMMM
MMMMMM `UOJ
`sMMMMMMMMMMMMM+ MMMMMM
MMMMMMMMMMMMMM +MMMMM
:sdMMMMMMMMMM MMMMM
MMMMMM `UOJ
MMMMMM
+MMMMM
MMMMM
`UOJ
Atlassian Jira
Version : 8.22.6
If you encounter issues starting or stopping Jira, please see the Troubleshooting guide at https://docs.atlassian.com/jira/jadm-docs-0822/Troubleshooting+installation
Using JIRA_HOME: /var/application-data/atlassian/jira
Server startup logs are located in /opt/atlassian/jira/atlassian-jira-software-8.22.6-standalone/logs/catalina.out
Using CATALINA_BASE: /opt/atlassian/jira/atlassian-jira-software-8.22.6-standalone
Using CATALINA_HOME: /opt/atlassian/jira/atlassian-jira-software-8.22.6-standalone
Using CATALINA_TMPDIR: /opt/atlassian/jira/atlassian-jira-software-8.22.6-standalone/temp
Using JRE_HOME: /usr/lib/jvm/jre
Using CLASSPATH: /opt/atlassian/jira/atlassian-jira-software-8.22.6-standalone/bin/bootstrap.jar:/opt/atlassian/jira/atlassian-jira-software-8.22.6-standalone/bin/tomcat-juli.jar
Using CATALINA_OPTS:
Using CATALINA_PID: /opt/atlassian/jira/atlassian-jira-software-8.22.6-standalone/work/catalina.pid
/opt/atlassian/jira/atlassian-jira-software-8.22.6-standalone/bin/check-java.sh: line 31: [: 11.0.18: integer expression expected
/opt/atlassian/jira/atlassian-jira-software-8.22.6-standalone/bin/set-gc-params.sh: line 5: [: 11.0.18: integer expression expected
Tomcat started.
Error:
/opt/atlassian/jira/atlassian-jira-software-8.22.6-standalone/bin/check-java.sh: line 31: [: 11.0.18: integer expression expected
/opt/atlassian/jira/atlassian-jira-software-8.22.6-standalone/bin/set-gc-params.sh: line 5: [: 11.0.18: integer expression expected
Error:
/opt/atlassian/jira/atlassian-jira-software-8.22.6-standalone/bin/check-java.sh: line 31: [: 11.0.18: integer expression expected
/opt/atlassian/jira/atlassian-jira-software-8.22.6-standalone/bin/set-gc-params.sh: line 5: [: 11.0.18: integer expression expected
Following message is captured in catalina.out file
1
2
3
4
[0.001s][warning][gc] -Xloggc is deprecated. Will use -Xlog:gc:/opt/atlassian/jira/atlassian-jira-software-8.22.6-standalone/logs/atlassian-jira-gc-%t.log instead.
Unrecognized VM option 'UseGCLogFileRotation'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Cause
When Java 11 is installed from AppStream repo using command,
1
dnf install -y java-11-openjdk-headless
Java version is displayed as openjdk 11.0.18-ea
1
2
3
4
5
[root@02db19e54355 bin]# java --version
openjdk 11.0.18-ea 2023-01-17 LTS
OpenJDK Runtime Environment (Red_Hat-11.0.18.0.9-0.3.ea.el8) (build 11.0.18-ea+9-LTS)
OpenJDK 64-Bit Server VM (Red_Hat-11.0.18.0.9-0.3.ea.el8) (build 11.0.18-ea+9-LTS, mixed mode, sharing)
check-java.sh script fails to recognize Java version due to "-ea" and this causes Jira installation to fail
Solution
Bug: JRASERVER-77097 has been raised to address the issue with check-java.sh. Till the bug gets fixed, follow the steps below to fix the issue
Replace following code in check-java.sh
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
if [[ $java_raw_version = *-ea* ]] then # early access format e.g 11-ea IFS='-' read -a values <<< "$java_raw_version" java_version=${values[0]} else if [[ $java_raw_version = 1.* ]] then # old format e.g. 1.8.0_161 IFS='.' read -a values <<< "$java_raw_version" java_version=${values[1]} else # new format e.g. 10.0.1 IFS='.' read -a values <<< "$java_raw_version" java_version=${values[0]} fi fi
with
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
if [[ $java_raw_version = *-ea* ]] then # early access format e.g 11-ea or 11.0.8-ea IFS='-' read -ra java_raw_version <<< "$java_raw_version" fi if [[ $java_raw_version = 1.* ]] then # old format e.g. 1.8.0_161 IFS='.' read -ra values <<< "$java_raw_version" java_version=${values[1]} else # new format e.g. 11 or 11.0.18 IFS='.' read -ra values <<< "$java_raw_version" java_version=${values[0]} fi
Start Jira service using ./start-jira.sh
Was this helpful?