# Change the Java version used by Jira server

#### Still need help?

The Atlassian Community is here for you.

Platform Notice: Server and Data Center Only - This article only applies to Atlassian products on the server and data center platforms.

## Purpose

Depending on the applications used on your environment, you may not be able to update the Java Runtime Environment to a version compatible with JIRA in a system-wide manner, as this could break older applications relying on older versions of Java.

In case you installed JIRA through its installer, these instructions may not prove useful since that will always include a compatible version and use that instead of the one defined on your operating system. However, when JIRA is installed through an archive file, JRE does not come bundled.

Changing to JDK 64bit on a JIRA which uses 32Bit installer is not possible.

The following Java flags are no longer supported in Java 9 and upwards.

-XX:+PrintGCDetails
-XX:+PrintGCDateStamps
-XX:+PrintGCTimeStamps
-XX:+PrintGCCause
-XX:+UseGCLogFileRotation
-XX:NumberOfGCLogFiles=5
-XX:GCLogFileSize=20M
-Xloggc:<PATH_TO_GC_LOGS>

Depending on the version of Jira these flags are set in the setenv.sh/.bat file, which is located under JIRA_INSTALL/bin/ path.

You must remove these flags when running JIRA with Java 11, otherwise JIRA will fail to start.
Make sure to add the one below to keep logging GC activity.

-Xlog:gc*:file=<PATH_TO_GC_LOGS>:time,uptime:filecount=5,filesize=20M
These flags are set under JIRA_INSTALL/bin/set-gc-params.sh

## Solution

1. Install/download the version of Java required by JIRA (see Supported Platforms);
2. Stop JIRA;
3. Set the path where you installed Java as the JAVA_HOME (JDK) or JRE_HOME (JRE) variables for JIRA (see instructions below);

Note: If JRE_HOME is not defined, Jira will define its value using the JAVA_HOME value.

### Windows (Manual Start)

• Go to the path where you installed JIRA, then open the bin folder;
• Edit the setenv.bat file, including the below just under the @echo off line;

If the JAVA installed is JRE:

SET JRE_HOME="\path\to\new\jre"

If the JAVA installed is JDK:

SET JAVA_HOME="\path\to\new\jdk"
• Set PATH  to include the <Java>\bin folder;
SET PATH="\path\to\new\jdk or jre\bin;%PATH%" 
• Restart JIRA;

### Windows (running Jira as a Service)

1. Stop the JIRA service;
2. Run the below command on a Command Prompt as an Administrator, inside the bin folder of JIRA's Installation Directory;

tomcat8w.exe //ES//JIRA050815072407 

This command is dependent on the version of Tomcat your instance is using. Check the executable present in <JIRA Install Directory>/bin/

You can get the service name by going to your Windows services and copying the service name for the "Atlassian JIRA" service. For example, 'JIRA050815072407' in this case.

3. On the Java tab, choose the location of the jvm.dll file into another JDK/JRE installation directory;
4. Start the JIRA service;

### Linux/Unix

• Go to the location where you installed JIRA, then to the bin folder;
• Edit the setenv.sh file and add the line at the initial lines:

If the JAVA installed is JRE:

JRE_HOME="/path/to/new/jre"

If the JAVA installed is JDK:

JAVA_HOME="/path/to/new/jdk"
For instance: JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home"
• Set PATH  to include the <Java>/bin folder
PATH="/path/to/new/jdk or jre/bin:\$PATH"
• Restart JIRA

Description Depending on the applications used on your environment, you may not be able to update the Java Runtime Environment to a version compatible with JIRA in a system-wide manner, as this could break older applications relying on older versions of Java. Jira Server

Yes
No