Issue while upgrading from JDK-8 to JDK-11 in JIRA Server plugin

Hello Developers,
I need your help. I am a Software Engineer. Our team develops a plugin on the JIRA Server(Jira version: 8.3.0). We want to upgrade our JDK from 8 to 11.

But according to this article,

Jira provides support to JDK 8 & 11 both. But JDK 11 features are not supported. I am unable to understand this.

Could you please tell me what I need to do if I want to use JDK 11 anyhow in my development? Could you please help me with this? What do I need to do if I want to deploy my Java 11 JAR over the JIRA Server?

Regards,
Heli

1 Like

I would also like to have an answer to this question. +1

You can’t. Java 11 code does not run on Java 8 JVM. Stay with Java 8 until Atlassian stops supporting Java 8.

2 Likes

Why should we wait for Atlassian to stop support for Java 8 if they already have support for Java 11? Would waiting not be leaving it too late? Also, can the development not happen for both 8 and 11 concurrently?

Hi @dennis.fischer and @Taylan,

As far as i know Jira 8.x supports both JDK8 and JDK11 BUT:

You can run Jira itself on JDK 8 or JDK11
You can compile your plugin with JDK8 or JDK11
However, your plugin should not use Java 11-specific features (like var, HttpClient, java.util.Optional.isEmpty(), etc.)

Jira 8.x’s core codebase is written in Java8. Even if the Jira platform can run on JDK11, it’s not designed to make use of JDK 11-only features.

What you could do:
If you want to develop your plugin with JDK11 and deploy to Jira 8.x, i would say you have two options:

  1. Compile your plugin for Java 8 (recommended for Jira 8.x). Even if you develop using JDK11, you can configure your maven-compiler-plugin to compile for java8. This ensures the generated .jar is compatible with Jira own classloader, which may assume java 8 bytecode.
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.8.1</version>
    <configuration>
        <source>1.8</source>
        <target>1.8</target>
    </configuration>
</plugin>

Your benefit:

  • Your plugin is still compatible with Jira 8.x.
  • You can still use some JDK 11 benefits during development (in your IDE), like better tooling.
    However, you cannot use JDK-11 specific language features in your plugin code.

Better is to update to Jira 9.x. Jira 9 has better support for JDK 11.

Hope this helps :slight_smile:

Cheers,
Daniel