jython can't find standard libraries

Bug #347789 reported by Daanemanz
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
jython (Ubuntu)
New
Undecided
Unassigned

Bug Description

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_07
>>> 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.

Tags: jython
Daanemanz (daanemanz)
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.