Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-76224

Jira does not work when switching to Java 17 in a supported release

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Low Low
    • 9.11.0
    • 9.5.0, 9.6.0, 9.7.0, 9.8.0, 9.9.0, 9.10.0, 9.14.1, 9.12.10
    • Environment - Java
    • None
    • 9.05
    • Severity 3 - Minor
    • 1
    • Hide

      Notes about the fix on Jira 9.11.0:

      • On Linux
        • The file <jira-install>/bin/java-opens.txt was created with the necessary properties.
        • The <jira-install>/bin/setenv.sh has a new line as below.
          JVM_OPENS=$(cat $PRGDIR/java-opens.txt)
          
      • On Windows
        • Similar strategy as above, however the file changed in setenv.bat with the following entry.
          set /p JVM_OPENS=<"%_PRG_DIR%java-opens.txt"
          
      • On Windows service
        • The necessary entries were added to the service.bat file, so the service definition would be updated once installed.
      Show
      Notes about the fix on Jira 9.11.0: On Linux The file <jira-install>/bin/java-opens.txt was created with the necessary properties. The <jira-install>/bin/setenv.sh has a new line as below. JVM_OPENS=$(cat $PRGDIR/java-opens.txt) On Windows Similar strategy as above, however the file changed in setenv.bat with the following entry. set /p JVM_OPENS=< "%_PRG_DIR%java-opens.txt" On Windows service The necessary entries were added to the service.bat file, so the service definition would be updated once installed.

      Problem

      Environment

      Java 17 and Jira 9.5+

      Steps to Reproduce

      • Install Jira 9.5+ with .zip or tar.gz packages
        or
      • Install Jira 9.5+ with Java 11 and switch to Java to 17

      Expected Results

      Jira to work correctly since it is in the supported platforms list

      Actual Results

      Jira main page is blank, errors are seen in the logs similar to:

      JIRA-Bootstrap ERROR      [c.a.jira.startup.ComponentContainerLauncher] An Error occurred during ComponentContainerLauncher servlet context initialisation - class com.atlassian.jira.issue.customfields.manager.xml.AllowlistedXStreamFactory (in unnamed module @0x3e2adf76) cannot access class sun.util.calendar.BaseCalendar$Date (in module java.base) because module java.base does not export sun.util.calendar to unnamed module @0x3e2adf76.
      

      Workaround

      Linux:

      1. Stop Jira
      2. Edit the jira-install/bin/catalina.sh file and search for the following line:
        export JDK_JAVA_OPTIONS
        
      3. Add the following code above that line
        ### Added as a workaround for Java 17 ###
        JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=java.base/java.lang.reflect=ALL-UNNAMED"
        JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED"
        JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=java.management/javax.management=ALL-UNNAMED"
        JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=java.desktop/sun.font=ALL-UNNAMED"
        JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=java.base/sun.reflect.generics.parser=ALL-UNNAMED"
        JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED"
        JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=java.base/java.time=ALL-UNNAMED"
        JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-exports=java.base/sun.util.calendar=ALL-UNNAMED"
        JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-exports=java.base/sun.security.action=ALL-UNNAMED"
        JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-exports=java.xml/jdk.xml.internal=ALL-UNNAMED"
        JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=java.base/java.lang=ALL-UNNAMED"
        ### --- ###
        
      4. Start Jira

      Windows ( when startng via BAT file ):

      1. Stop Jira
      2. Edit the file JIRA_INSTAL\bin\catalina.bat and search for the following line:
        rem Configure JAVA 9 specific start-up parameters
        
      3. Add the below code, below that line:
        rem Added as a workaround for Java 17
        set "JDK_JAVA_OPTIONS=%JDK_JAVA_OPTIONS% --add-opens=java.base/java.lang.reflect=ALL-UNNAMED"
        set "JDK_JAVA_OPTIONS=%JDK_JAVA_OPTIONS% --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED"
        set "JDK_JAVA_OPTIONS=%JDK_JAVA_OPTIONS% --add-opens=java.management/javax.management=ALL-UNNAMED"
        set "JDK_JAVA_OPTIONS=%JDK_JAVA_OPTIONS% --add-opens=java.desktop/sun.font=ALL-UNNAMED"
        set "JDK_JAVA_OPTIONS=%JDK_JAVA_OPTIONS% --add-opens=java.base/sun.reflect.generics.parser=ALL-UNNAMED"
        set "JDK_JAVA_OPTIONS=%JDK_JAVA_OPTIONS% --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED"
        set "JDK_JAVA_OPTIONS=%JDK_JAVA_OPTIONS% --add-opens=java.base/java.time=ALL-UNNAMED"
        set "JDK_JAVA_OPTIONS=%JDK_JAVA_OPTIONS% --add-exports=java.base/sun.util.calendar=ALL-UNNAMED"
        set "JDK_JAVA_OPTIONS=%JDK_JAVA_OPTIONS% --add-exports=java.base/sun.security.action=ALL-UNNAMED"
        set "JDK_JAVA_OPTIONS=%JDK_JAVA_OPTIONS% --add-exports=java.xml/jdk.xml.internal=ALL-UNNAMED"
        
      4. Start Jira

      Windows (when running as service):

      1. Stop Jira
         tomcat9w //ES//service_name
      2. Then edit in the Java Options (not the Java 9 Options) and replace all the {}add-opens{-} and -add-exports with the following:
        --add-opens=java.base/java.lang=ALL-UNNAMED
        --add-opens=java.base/java.lang.reflect=ALL-UNNAMED
        --add-opens=java.base/java.util=ALL-UNNAMED
        --add-opens=java.base/java.util.concurrent=ALL-UNNAMED
        --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED
        --add-opens=java.base/java.io=ALL-UNNAMED
        --add-opens=java.base/java.nio.file=ALL-UNNAMED
        --add-opens=java.management/javax.management=ALL-UNNAMED
        --add-opens=java.desktop/sun.font=ALL-UNNAMED
        --add-opens=java.base/sun.reflect.generics.parser=ALL-UNNAMED
        --add-opens=java.base/java.time=ALL-UNNAMED
        --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED
        --add-exports=java.base/sun.util.calendar=ALL-UNNAMED
        --add-exports=java.base/sun.security.action=ALL-UNNAMED
        --add-exports=java.xml/jdk.xml.internal=ALL-UNNAMED
        
      3. Start Jira

              Unassigned Unassigned
              2bc7c297d2fe Artur Licks
              Votes:
              1 Vote for this issue
              Watchers:
              38 Start watching this issue

                Created:
                Updated:
                Resolved: