我想让qtjambi和jython一起玩得很好。以下是我做的测试:
>jython -Dpython.path=./qtjambi-4.5.2_01.jar:./qtjambi-linux64-gcc-4.5.2_01.jar:.
Jython 2.2.1 on java1.6.0_18
Type "copyright", "credits" or "license" for more information.
>>> from com.trolltech.qt.gui import *
>>> dir(QApplication)
['aboutQt', 'aboutQtJambi', 'activeModalWidget', 'activePopupWidget', 'activeWindow', 'alert', 'allWidgets', 'beep', 'changeOverrideCursor', 'clipboard', 'closeAllWindows', 'colorSpec', 'commitData', 'commitDataRequest', 'cursorFlashTime', 'desktop', 'desktopSettingsAware', 'doubleClickInterval', 'exec', 'focusChanged', 'focusWidget', 'font', 'fontDatabaseChanged', 'fontMetrics', 'fromNativePointer', 'globalStrut', 'initialize', 'inputContext', 'instance', 'isEffectEnabled', 'isLeftToRight', 'isRightToLeft', 'isSessionRestored', 'keyboardInputDirection', 'keyboardInputInterval', 'keyboardInputLocale', 'keyboardModifiers', 'lastWindowClosed', 'layoutDirection', 'mouseButtons', 'notify', 'overrideCursor', 'palette', 'quitOnLastWindowClosed', 'restoreOverrideCursor', 'saveState', 'saveStateRequest', 'sessionId', 'sessionKey', 'sessionRestored', 'setActiveWindow', 'setColorSpec', 'setCursorFlashTime', 'setDesktopSettingsAware', 'setDoubleClickInterval', 'setEffectEnabled', 'setFont', 'setGlobalStrut', 'setGraphicsSystem', 'setInputContext', 'setKeyboardInputInterval', 'setLayoutDirection', 'setOverrideCursor', 'setPalette', 'setQuitOnLastWindowClosed', 'setStartDragDistance', 'setStartDragTime', 'setStyle', 'setStyleSheet', 'setWheelScrollLines', 'setWindowIcon', 'startDragDistance', 'startDragTime', 'style', 'styleSheet', 'syncX', 'topLevelAt', 'topLevelWidgets', 'type', 'wheelScrollLines', 'widgetAt', 'windowIcon']
>>> QApplication.initialize([])
Traceback (innermost last):
File "<console>", line 1, in ?
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: Could not initialize class com.trolltech.qt.gui.QApplication
我尝试编译并运行一个简单的“hello world”qtjambi示例,它运行良好。
你知道我做错了什么吗?
谢谢