Comment 0 for bug 347789

Revision history for this message
Daanemanz (daanemanz) wrote :

Binary package hint: jython

Using The Grinder, we came up to a quirk in jython 2.2.1 on Intrepid 32-bit. When using jython scripts from The Grinder, we use standard jython (2.2.1-1ubuntu3) and java (sun-java6-jre, jdk and bin, version 6-07-3ubuntu2) libraries, but in some cases jython cannot find these libraries.

jython.jar itself is located in /usr/share/java, whereas its libraries are located in /usr/share/jython/Lib. I'm sure that the 'standard' /usr/bin/jython script sets the directories correctly, but when jython is started directly from its directory by calling 'java -jar /usr/share/java/jython.jar', and you try to import, let's say 'random', jython will give you an error:

me@mylaptop:/usr/share/java$ java -jar jython.jar
Jython 2.2.1 on java1.6.0_10
>>> import random
Traceback (innermost last):
  File "<console>", line 1, in ?
ImportError: no module named random

We also found a workaround by creating a symlink to /usr/share/jython/Lib in the /usr/share/java directory. Somehow jython looks for a 'Lib' directory in its current directory to find its libraries. We think that either jython.jar should be placed in the /usr/share/jython directory, or a symlink as described should be added to the package.