Skip to content, Skip to search


Jython Scripting

173 bytes added, 12 February
Self written Jython modules for ImageJ: Mention the manual way to reload compiled module
This tells us that the folder <code>jars/Lib/</code> inside our ImageJ/Fiji directory is the right place to save modules. As <code>Lib/</code> does not exist by default, we have to create it.
When a module is imported for the first time, Jython will compile it to Java code. If there is a module named <code></code>, Jython will create a file called <code>myModule$py.class</code>. The next time the module is imported, Jython will use the jython interpreter uses the <code>.class </code> file instead of the <code>.py </code> file, even if this <code>. When modifying py</code> file was modified.  To force the module, it necessary interpreter to restart ImageJ/use the last version of the py script there are 2 possibilities : * Close Fiji to use , delete the modified one<code>myModule$py. A work around is class</code> file and restart Fiji* Use the following lines of code (found at [ stackoverflow]) that will force Jython to recompile all modules:
<source lang='python'>