Since version 2026, Flux 3D and Flux PEEC are no longer available.

Please use SimLab to create a new 3D project or to import an existing Flux 3D project.

Please use SimLab to create a new PEEC project (not possible to import an existing Flux PEEC project).

/!\ Documentation updates are in progress – some mentions of 3D may still appear.

How to Use External Jython Classes in Flux?

Introduction

The version of Jython has been updated from 2.7.0 to 2.7.1.

The new version 2.7.1 offers new interesting modules as numpy and scipy, but only a few tests have been done. However we guarantee the no-regression.

User*.jar library can be placed in a specific folder, and automatically read by Flux.

<INSTALLFLUX>\Third_party\jython-2.7.1\javalib

Goal

Sometimes a user would like to extend the capabilities of the python scripts run by Flux for example to access a database.

This often requires to add third party jars to the classpath of Flux so that those third party classes become available in the Flux Jython session.

Prerequisite

The method described below requires that at least version 2018.1 of Flux is installed.

Step-by-step

Here the step-by-step below:
  1. Download the jar(s) that contains the classes you want to use in Flux Jython
  2. Copy the jar(s) in %INSTALLFLUX%\Third_party\jython-2.7.1\javalib
  3. Start (or restart) Flux

Example

Install the MySQL connector jar in jython-2.7.1\javalib folder:

In MyFlux shell window run the following:

You should get something like below printed in the Output console: