---
schema_version: "1"
id: 270368d339d79c64ae39246f2373acd1cd485b77a98146bd30f7544ccee2b2b2
title: Java Version Support
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/mule-sdk/latest/java-version-support.md
canonical_url: https://docs.mulesoft.com/mule-sdk/latest/java-version-support
source_site: docs.mulesoft.com
content_type: documentation
content_hash: f48187c1fcf87542e4d1cab08cec50c257b122a4b4482f9f7555b08eb84087b8
description: MuleSoft Documentation Site
release: "1.13"
latest: true
---
---
product: Mule SDK
version: 1.13
is-latest-version: true
---

# Java Version Support

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Specify the Java compatibility of your custom module. In Mule 4.6.0 and later, custom modules that
do not specify the Java compatibility are assumed to be compatible with Java 8 and Java 11 only. If
your custom module is compatible with a more recent Java version, you must specify the Java
compatibility to include that version.

Communicating the Java compatibility of your custom module also ensures:

- Safe upgrades

  Users can determine whether their Mule applications can safely upgrade to run on a given Java
  version, ensuring a smooth transition and avoiding potential issues.

- User experience

  Providing clear information about Java compatibility enhances the user experience, especially for
  Anypoint Exchange users who rely on this information for selecting modules.

## Specify Java Compatibility

To specify Java compatibility of your custom module:

1.  Generate metadata to specify Java compatibility of your custom module by adding or upgrading the
    custom module `mule-sdk-api` dependency to the latest version, for example:

    ```xml
    <dependency>
       <groupId>org.mule.sdk</groupId>
       <artifactId>mule-sdk-api</artifactId>
       <version>0.11.0</version>
    </dependency>
    ```

2.  Add the `@JavaVersionSupport` annotation in the same class as the `@Extension` annotation and
    include the supported Java versions as values, for example:

    ```java
    import org.mule.sdk.api.annotation.JavaVersionSupport;
    import org.mule.sdk.api.meta.JavaVersion;

    @Extension(name = "Database")
    @Operations(...)
    @JavaVersionSupport({JavaVersion.JAVA_8, JavaVersion.JAVA_11, JavaVersion.JAVA_17})
    public class DatabaseConnector {
    ..
    }
    ```

> [!NOTE] If the `mule-modules-parent` version is earlier than 1.9.0, all code, including
> third-party dependencies, **must** be compiled for Java 8, and you must use Java 8 to build the
> connector.

You can mark your custom module as compatible with a single Java version only; however, you must
ensure that no adoption or backward compatibility issues exist.

When you deploy a Mule app, Mule verifies that all modules in the Mule app are compatible with the
Java version. If Mule finds an incompatibility, Mule throws an error and the application does not
deploy.

If your code is compatible with a given Java version but you do not declare that compatibility, you
can still get a successful test run (only when running a test on Java 8).

## See Also

- [Upgrading Java for Custom Connectors (Customers)](https://docs.mulesoft.com/general/customer-connector-upgrade)

- [Upgrading Java for Custom Connectors (Partners)](https://docs.mulesoft.com/general/partner-connector-upgrade)

- [Java Support](https://docs.mulesoft.com/general/java-support)
