Loading

How to change java version for mule runtime

Publiceringsdatum: Mar 2, 2024
Uppgift

GOAL

How to change Java Version or Home for mule runtime.

For example, it may be that there are installs of multiple java homes (1.8, 9, 10, 11). It's important to know that specific Mule versions are not compatible with previous versions of java, nor can the Tanuki service wrapper itself be compatible with specific versions of Java.

In this case, you have to change Java home for both Tanuki wrapper as well as Mule.
Following is execution order of Mule runtime:

Launcher script --> Tanuki Service Wrapper --> Mule
Steg
In order to ensure you are using the right java home, you need to make sure Tanuki wrapper as well as launcher script under <mule home>/bin are both referencing the right java home.
  • Change Mule Java Home (recommended): update the following under MULE_HOME/conf/wrapper.conf which is used by the wrapper to start the JVM instance for Mule.
    Locate and change the value of the following line to java home absolute path; if left unchanged it will call the Operating System specific one.
From:
wrapper.java.command=java
To:
wrapper.java.command=<Java Home>/bin/java

Note that the path should point to the Java executable of a JDK installation rather than a JRE.

  • Change Launcher Java Home. The launcher is used to start Tanuki service wrapper process which can start Mule. Please note it will try to resolve Java home using command “which java” in Linux. In some cases when you have multiple Java Home, it is not possible to change PATH variable in Linux/Windows to promote explicit versions of Java, as it may affect other applications. In such a case you can modify <mule home>/bin/launcher(.bat) as follows:
JAVA=
if [ -n "`which java 2>/dev/null`" ]
then
    JAVA=java
else
    if [ ! -z "$JAVA_HOME" ]
    then
        JAVA=$JAVA_HOME/bin/java
    fi
fi
JAVA=<Java Home>/bin/java
 
 
 
Knowledge-artikelnummer

001114832

 
Laddar
Salesforce Help | Article