[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: java+jython: ImportError: cannot import name newString



Gilles Filippini a écrit , Le 28/11/2010 19:03:
> I need some help to understand an issue I have while trying to package a
> java app which exec some jython script.
> 
> I came up with the attached simple test case which I compile using:
> $ javac -cp "/usr/share/java/jython.jar" TestJython.java
> 
> Then I execute:
> $ JYTHONPATH="/usr/share/jython/Lib" \
>   CLASSPATH=".:/usr/share/java/jython.jar:/usr/share/java/jna.jar:\
>   /usr/share/java/asm3.jar:/usr/share/java/antlr3-runtime.jar:\
>   /usr/share/java/jna-posix.jar" \
>   java TestJython
> 
> It gives me the following error:
>  Exception in thread "main" Traceback (most recent call last):
>    File "<string>", line 1, in <module>
>  ImportError: cannot import name newString
> 
> While:
> $ jython -c "from org.python.core.Py import newString as asPyString"
> 
> runs fine.

Answering to myself...

Looking at the /usr/bin/jython script, I've eventually found out that it
works fine with /usr/share/java/libconstantine-java.jar added to the
classpath.

Don't know why, though.

Thanks,

(Please CC me on replies)

_g.

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: