Change the Jython version used by xDI Runtime
Jython is a project that lets you write Python scripts in Java. Semarchy xDI Runtime comes with Jython libraries, allowing you to use Python in scripting actions.
This article explains how to use a different version of Jython than the one that comes with the runtime.
When changing Jython libraries, make sure they are compatible with the version of Java used by the runtime. |
Download and install Jython
Open a web browser and go to the official Jython website. From the download section, download one of the files named Jython Standalone or Jython Standalone JAR.
Next, go to the runtime install directory on your computer, and navigate to the lib\jython
subdirectory. Create a new directory in lib\jython
. Give it a name you can recognize, such as the version of Jython you are installing.
Move the downloaded Jython JAR file to the directory you created.
Configure xDI Runtime
You must now make your runtime aware of the changed library.
Find the runtime configuration file, engineParameters.xml
, in the properties
subdirectory of the runtime install path. Open engineParameters.xml
for editing.
Find the parameter with the attribute name="jythonVersion"
. Set the value
attribute to the name of the folder you created, and uncomment the parameter if it is commented out. You can also create the parameter yourself as the following example:
<parameters>
<...>
<engineParameters>
<!-- Make sure the parameter is under the <engineParameters> node -->
<parameter name="jythonVersion" value="2.7-new-folder"/>
<...>
</engineParameters>
<...>
</parameters>
Save the configuration file, and start the runtime to take the changes into account.