Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I had similar issues, and it turns out that <strong>since the standalone Jython dist does not support caching, it also does not support the "import *" approach.</strong> This is not clearly documented anywhere in the official Jython docs, but I concluded this based on a number of different bug reports:</p> <ul> <li><a href="https://groups.google.com/forum/?hl=en&amp;fromgroups=#!topic/robotframework-users/6ipB0DYJkvU">https://groups.google.com/forum/?hl=en&amp;fromgroups=#!topic/robotframework-users/6ipB0DYJkvU</a></li> <li><a href="http://bugs.jython.org/issue1778514">http://bugs.jython.org/issue1778514</a></li> <li><a href="http://bugs.jython.org/issue1422">http://bugs.jython.org/issue1422</a></li> <li><a href="http://bugs.jython.org/issue1692579">http://bugs.jython.org/issue1692579</a></li> </ul> <p>Notable from that last link: </p> <blockquote> <p>So as Oti noted, in standalone you must do full imports to succeed.</p> </blockquote> <p>To fix your issue, <strong>use the non-standalone standard jython.jar</strong> generated by installing jython using the 'Standard' option. </p> <p>If you wanted to package and distribute jython.jar with your application, in case a user does not have Jython installed, then you will also need to copy/pase the complete "Lib" folder from the jython installation directory into whichever location you end up placing jython.jar. This enables access to the python stdlib which is not included in the standard jar file.</p> <p><strong>UPDATE</strong>: After playing around more, I think I have a fix to enable "import *" type imports even when using the standalone jar. All that needs to be done is to enable caching!</p> <p>You can do this by either adding the following options to the jvm when running jython:</p> <blockquote> <p>-Dpython.cachedir.skip=<strong>false</strong> -Dpython.cachedir=DESIRED CACHE PATH</p> </blockquote> <p>(Note that the second argument is optional, and if left blank, a default value will be used)</p> <p>If you are having an issue running the InteractiveConsole embedded in an app (which is what my problem was) you can add these properties before initializing the console:</p> <pre><code> Properties props = new Properties(); props.put("python.cachedir.skip", "false"); props.put("python.cachedir", "DESIRED CACHE PATH"); // again, this option is optional InteractiveConsole.initialize(System.getProperties(), props, new String[0]); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload