24 Jan 2013

Jython problem on Windows 7 64bit OS

收藏到CSDN网摘
安装了Jython2.7a2在windows 7 64bit上.简单的一个字符串测试s = "test"就出错了,会死住没有反应.后来测试了jython2.5.3也是一样的问题,input()也会出问题.后来看控制台输出命令发现问题是由于jffi的某个包引起.暂时还没找到解决办法.但是测试发现了一个在出现这个错误时也能使用jython写程序的办法.

就是新建一个快捷方式在桌面,目标地址是:
C:\jython2.7a2\bin\jython.bat "C:\jython2.7a2\Demo\swing\JythonConsole\Console.py"
然后双击,虽然控制台还是会出问题,不过会有一个类似IDLE的窗体弹出,在这个窗体中写代码,不会出错.虽然没有任何自动完成与参数提示,但是作为临时IDLE还是够用了.

附上jython.bat的错误信息,看样子跟64位系统有关
java.lang.ExceptionInInitializerError
        at com.kenai.jffi.Foreign.getInstance(Foreign.java:95)
        at com.kenai.jffi.Type$BuiltinTypeInfo.(Type.java:265)
        at com.kenai.jffi.Type$Builtin.size(Type.java:216)
        at jnr.ffi.provider.jffi.NativeRuntime$TypeDelegate.size(NativeRuntime.j
ava:153)
        at jnr.ffi.provider.AbstractRuntime.(AbstractRuntime.java:48)
        at jnr.ffi.provider.jffi.NativeRuntime.(NativeRuntime.java:55)
        at jnr.ffi.provider.jffi.NativeRuntime.(NativeRuntime.java:39)
        at jnr.ffi.provider.jffi.NativeRuntime$SingletonHolder.(NativeRu
ntime.java:51)
        at jnr.ffi.provider.jffi.NativeRuntime.getInstance(NativeRuntime.java:47
)
        at jnr.ffi.provider.jffi.Provider.(Provider.java:31)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at java.lang.Class.newInstance0(Unknown Source)
        at java.lang.Class.newInstance(Unknown Source)
        at jnr.ffi.FFIProvider$SystemProviderSingletonHolder.getInstance(FFIProv
ider.java:75)
        at jnr.ffi.FFIProvider$SystemProviderSingletonHolder.(FFIProvide
r.java:64)
        at jnr.ffi.FFIProvider.getSystemProvider(FFIProvider.java:33)
        at jnr.ffi.Runtime$SingletonHolder.(Runtime.java:37)
        at jnr.ffi.Runtime.getSystemRuntime(Runtime.java:32)
        at jnr.posix.NativePOSIX.(NativePOSIX.java:9)
        at jnr.posix.BaseNativePOSIX.(BaseNativePOSIX.java:29)
        at jnr.posix.WindowsPOSIX.(WindowsPOSIX.java:120)
        at jnr.posix.POSIXFactory.loadWindowsPOSIX(POSIXFactory.java:101)
        at jnr.posix.POSIXFactory.loadPOSIX(POSIXFactory.java:50)
        at jnr.posix.LazyPOSIX.loadPOSIX(LazyPOSIX.java:32)
        at jnr.posix.LazyPOSIX.posix(LazyPOSIX.java:28)
        at jnr.posix.LazyPOSIX.isatty(LazyPOSIX.java:178)
        at org.python.core.io.StreamIO.isatty(StreamIO.java:234)
        at org.python.core.io.BufferedIOMixin.isatty(BufferedIOMixin.java:90)
        at org.python.core.io.TextIOBase.isatty(TextIOBase.java:175)
        at org.python.core.PyFile.file_isatty(PyFile.java:485)
        at org.python.core.PyFile.isatty(PyFile.java:480)
        at org.python.core.PySystemState.initEncoding(PySystemState.java:273)
        at org.python.core.PySystemState.(PySystemState.java:216)
        at org.python.core.PySystemState.doInitialize(PySystemState.java:918)
        at org.python.core.PySystemState.initialize(PySystemState.java:828)
        at org.python.core.PySystemState.initialize(PySystemState.java:778)
        at org.python.core.PySystemState.initialize(PySystemState.java:771)
        at org.python.util.jython.run(jython.java:159)
        at org.python.util.jython.main(jython.java:135)
Caused by: java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: could not
 locate stub library in jar file.  Tried [jni/x86_64-Windows/jffi-1.2.dll, /jni/
x86_64-Windows/jffi-1.2.dll]
        at com.kenai.jffi.Init.load(Init.java:73)
        at com.kenai.jffi.Foreign$InstanceHolder.getInstanceHolder(Foreign.java:
49)
        at com.kenai.jffi.Foreign$InstanceHolder.(Foreign.java:45)
        ... 42 more
Caused by: java.lang.UnsatisfiedLinkError: could not locate stub library in jar
file.  Tried [jni/x86_64-Windows/jffi-1.2.dll, /jni/x86_64-Windows/jffi-1.2.dll]

        at com.kenai.jffi.internal.StubLoader.getStubLibraryStream(StubLoader.ja
va:336)
        at com.kenai.jffi.internal.StubLoader.loadFromJar(StubLoader.java:283)
        at com.kenai.jffi.internal.StubLoader.load(StubLoader.java:226)
        at com.kenai.jffi.internal.StubLoader.(StubLoader.java:374)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Unknown Source)
        at com.kenai.jffi.Init.load(Init.java:68)
        ... 44 more

No comments :

Post a Comment