Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You need to make sure that Jython knows to search your .jar file for modules, which is done using pythonpath. This will differ depending on your setup, but in PyDev:</p> <ol> <li>In the Package Explorer (the tree on the left), right-click on the project and go to Properties.</li> <li>Select "PyDev - PYTHONPATH" on the left.</li> <li>Click the "Add zip/jar/egg" button on the right.</li> <li>Use the directory tree on the left to browse to the folder containing your jar, then click the checkbox next to the .jar file on the right, and click OK, then OK again.</li> </ol> <p>You should also check that the module name you are trying to import matches the package name as specified within the jar file. Note that the jar file might be named differently to the package, especially if there are multiple packages within it.</p> <p>If you have the source for the .jar, open up the .java file containing the code you wish to utilise, and look for a line near the top that specifies the package. If you find a line that says something like <code>package foo.bar.myJavaPackage;</code>, then you must do one of </p> <ul> <li>import it like <code>import foo.bar.myJavaPackage</code>, and use the contents like <code>obj = foo.bar.myJavaPackage.someClass</code>, or</li> <li>import it like <code>from foo.bar import myJavaPackage</code>, and use the contents like <code>obj = myJavaPackage.someClass</code>, or</li> <li>import it like <code>from foo.bar.myJavaPackage import someClass</code>, and use it like <code>obj = myClass</code>, but careful of name collisions using this method.</li> </ul>
 

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