You may or may not know that it is possible to access Jython code from Java without compiling it using the jythonc utility. This technique is possible using a mixture of Java interfaces and usage of the PythonInterpreter. As a matter of fact, I believe that using this technique correctly is more effective than using jythonc.
To put it simply, to use this technique you must create a "factory" method which uses the PythonInterpreter class to interpret a .py module for use within Java code. Any Java code that uses the Jython code should be coded against an interface which is implemented by the Jython code.
In order to provide a fully functional example, I've created a simple application with hard-coded data. This application shows the potential for using this technique within your Java applications to have the ability for use of dynamic Jython objects.
The application is simply called "jyinterface" and it contains four pieces of code:
Step By Step
We'll start by coding the "EmployeeType.java" interface which is what our Java code will use in order to interact with the Jython object:
Here is the "Main.java" code:
Next time you plan to create a Java application that contains some Jython code, give this technique a try...