Contact Us 1-800-596-4880

Selecting a Different Java Version to Run the Embedded Mule Runtime Engine

You can select any of your installed JREs as the default Java runtime environment that Studio uses to run your Mule project.

You can select the version of the JDK to use for the project that is compatible with the Mule runtime version the project runs on.

Learn more about compatible versions of Java at Anypoint Studio Release Notes.

Select the Java Version for All Your Studio Projects

  1. In Studio, click Anypoint Studio, and Preferences.

  2. Under Java, Installed JREs, select the JRE version to use.

    A table listing installed Java runtime environments with names, locations, and types

    If your installed JRE version doesn’t appear, you must configure it:

    1. Go to Add and select your installed JRE type:

      • MacOS X VM for MacOS.

      • Standard VM for MacOS, Windows, and Linux.

    2. Click Next.

    3. In JRE Home, click Directory and select the folder where you have installed JRE.
      For example, /Library/Java/JavaVirtualMachines/jdk-11.0.3.jdk/Contents/Home

    4. In JRE Name type in a descriptive name for the JRE.
      For example, Java SE 11.

    5. Click Finish.

Migrate Your Project to a Different Java Version

Studio 7.17.0 and later are compatible with Java 17, so you can upgrade modules and apps in your projects to obtain its latest features.

  1. Right-click on your Studio project.

  2. Navigate to Build Path, and click Configure Build Path.

  3. In the Libraries tab, select your JRE System Library and click Edit.

  4. Select the Alternate JRE option, and select your desired JRE from the drop-down menu.

    Edit Library window displaying the alternate JRE options.

If you select Java 17 for your project, Studio automatically searches Exchange and suggests the modules and connectors to upgrade to make your app compatible with Java 17.

If you find issues, you can troubleshoot them and then deploy your project to the appropriate environment with Java compatibility checks.

Verify Java 17 Tooling

In Studio 7.19.0 and later, your new Mule projects use JDK 17 by default and the bundled modules in your Mule projects must be Java 17 compatible. If you have issues with the modules that use previous versions of Java:

  1. Go to Settings > Anypoint Studio > Tooling.

  2. In the Life cycle section, select Java 17 as the Java virtual machine for Studio services.

  3. Click Apply and Close.

    The Studio services restart and the tooling instance restarts using Java 17.

To ensure your modules are Java 17 compatible, use the Java 17 module compatibility tool.

Verify Java 17 Module Compatibility

In Studio 7.19.0 and later, you can check if the modules in your Mule project are Java 17 compatible:

  1. Right-click on the name of your project.

  2. Select Mule > Java 17 Module Compatibility.

    Studio analyzes the modules in your Mule project and shows the modules that aren’t Java 17 compatible in the Problems tab.

  3. Update the modules that aren’t Java 17 compatible.

The problems tab is open, with one warning and three Java module compatibility notifications