Sébastien Boisgérault wrote:

Errrr ... stupid, sorry for this message. I was using 'jython.jar' directly
without any classpath information instead of the 'jython' script ... No
issue then :)




I have been experiencing some new problems with the Jython 2.2 release
that I don't remember having with the beta. Lots of java packages are
not available from the jython console as if the __classpath__ entry in
sys.path was not active anymore. For example:

boisgera@Sisyphe:~$ java -jar jython2.2/jython.jar
Jython 2.2 on java1.6.0
Type "copyright", "credits" or "license" for more information.
>>> import org.eclipse.swt.snippets.Snippet1
Traceback (innermost last):
  File "<console>", line 1, in ?
ImportError: no module named eclipse

Uhu ? Did I forgot to add the appropriate folder to the CLASSPATH ?

>>> import os
>>> "/home/boisgera/SANDBOX/SWT" in os.environ["CLASSPATH"]

No ... Is the "__classpath__" entry here then ?

>>> import sys
>>> sys.path
['', '/home/boisgera/jython2.2/Lib', '__classpath__']

Yes it is ... Well, just in case, let's add the path manually and try the
same import again:

>>> sys.path.append("/home/boisgera/SANDBOX/SWT")
>>> import org.eclipse.swt.snippets.Snippet1
>>> org.eclipse.swt.snippets.Snippet1
<jclass org.eclipse.swt.snippets.Snippet1 2>

It works !

Any idea ?



------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/

_______________________________________________ Jython-users mailing list Jython-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jython-users