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
-
In Studio, click Anypoint Studio, and Preferences.
-
Under Java, Installed JREs, select the JRE version to use.
If your installed JRE version does not appear, you must configure it:
-
Go to Add and select your installed JRE type:
-
MacOS X VM
for MacOS. -
Standard VM
for MacOS, Windows, and Linux.
-
-
Click Next.
-
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
-
In JRE Name type in a descriptive name for the JRE.
For example,Java SE 11
. -
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 connectors and apps in your projects to obtain its latest features.
-
Right-click in your Studio project.
-
Navigate to Build Path, and click Configure Build Path.
-
In the Libraries tab, select your JRE System Library and click Edit.
-
Select the Alternate JRE option, and select your desired JRE from the drop-down menu.
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.