我正在尝试通过 Ubuntu 软件中心在 Ubuntu 12.04 上安装的 Eclipse 3.7.2 上设置 Jython 解释器。Eclipse 是 eclipse-platform 3.7.2-1 版本。PyDev 已按照用户手册的指示安装(或者至少我相信如此),并且我尝试使用 PyDev 的更新和夜间构建来设置解释器。目前,PyDev 版本为:PyDev for Eclipse 2.6.0.2012050900 org.python.pydev.feature.feature.group Aptana
还安装了 Jyton: panton@maleficio:~$ dpkg -l |grep -i jython ii jython 2.5.1-2ubuntu2 Python 与 Java 无缝集成
我可以在“正确”目录中找到它:
panton@maleficio:~$ ls -1 /usr/share/java/jython* /usr/share/java/jython-2.5.1.jar
/usr/share/java/jython.jar panton@maleficio:~$
(第二个文件只是第一个文件的链接)。
这就是说,当我尝试创建一个新项目时,File -> New -> Project -> PyDev -> PyDev Project,然后 Next,我提供了三种项目类型:Python,这看起来不错,并显示一个组合框选择解释器,以及 Jython 和 Iron Python,它们(两者)都提醒我“请在继续之前在相关首选项中配置解释器。”。
对于接下来的段落,我将坚持使用 Jython 选项,因为 Iron Python 已经没有 Precise Pagolin (Ubuntu 12.04) 的“官方”发行版。
好的,然后我转到Window->Preferences,然后选择Interpreter-Jython,然后New,我选择一个正确的名称,Jython 2.5.1,然后是正确的路径,/usr/share/java/jython-2.5.1 。罐,
按确定,并收到此消息:
获取解释器信息时出错。常见原因包括: - 使用不受支持的版本(Jython 至少应该是 2.1,所以它是:它是 2.5.1 版本) - 指定了无效的解释器。完全没有,因为我选择的是真实文件,而不是链接。……………………………………………………………………………………………………………………………………
错误日志说:
See error log for details.
No output was in the standard output when trying to create the interpreter info.
The error output contains:>>error importing site
at org.python.core.PySystemState.getPath(PySystemState.java:513)
at org.python.core.PySystemState.getPathLazy(PySystemState.java:502)
at org.python.core.util.RelativeFile.<init>(RelativeFile.java:21)
at org.python.core.packagecache.PathPackageManager.packageExists(PathPackageManager.java:43)
at org.python.core.packagecache.SysPackageManager.packageExists(SysPackageManager.java:159)
at org.python.core.PyJavaPackage.__findattr_ex__(PyJavaPackage.java:132)
at org.python.core.PyObject.__findattr__(PyObject.java:869)
at org.python.core.packagecache.PackageManager.lookupName(PackageManager.java:136)
at org.python.core.JavaImporter.find_module(JavaImporter.java:39)
at org.python.core.JavaImporter.find_module(JavaImporter.java:25)
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: org/jruby/ext/posix/util/Platform
<<
------------------------------------------------------
The Workspace log on Eclipse says:
-------------------------------------------------------
eclipse.buildId=I20110613-1736
java.version=1.6.0_24
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments: -os linux -ws gtk -arch x86_64
Error
Sun May 20 08:39:09 CEST 2012
No output was in the standard output when trying to create the interpreter info.
The error output contains:>>error importing site
at org.python.core.PySystemState.getPath(PySystemState.java:513)
at org.python.core.PySystemState.getPathLazy(PySystemState.java:502)
at org.python.core.util.RelativeFile.<init>(RelativeFile.java:21)
at org.python.core.packagecache.PathPackageManager.packageExists(PathPackageManager.java:43)
at org.python.core.packagecache.SysPackageManager.packageExists(SysPackageManager.java:159)
at org.python.core.PyJavaPackage.__findattr_ex__(PyJavaPackage.java:132)
at org.python.core.PyObject.__findattr__(PyObject.java:869)
at org.python.core.packagecache.PackageManager.lookupName(PackageManager.java:136)
at org.python.core.JavaImporter.find_module(JavaImporter.java:39)
at org.python.core.JavaImporter.find_module(JavaImporter.java:25)
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: org/jruby/ext/posix/util/Platform
<<
java.lang.RuntimeException: No output was in the standard output when trying to create the interpreter info.
The error output contains:>>error importing site
at org.python.core.PySystemState.getPath(PySystemState.java:513)
at org.python.core.PySystemState.getPathLazy(PySystemState.java:502)
at org.python.core.util.RelativeFile.<init>(RelativeFile.java:21)
at org.python.core.packagecache.PathPackageManager.packageExists(PathPackageManager.java:43)
at org.python.core.packagecache.SysPackageManager.packageExists(SysPackageManager.java:159)
at org.python.core.PyJavaPackage.__findattr_ex__(PyJavaPackage.java:132)
at org.python.core.PyObject.__findattr__(PyObject.java:869)
at org.python.core.packagecache.PackageManager.lookupName(PackageManager.java:136)
at org.python.core.JavaImporter.find_module(JavaImporter.java:39)
at org.python.core.JavaImporter.find_module(JavaImporter.java:25)
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: org/jruby/ext/posix/util/Platform
<<
at org.python.pydev.ui.interpreters.AbstractInterpreterManager.createInfoFromOutput(AbstractInterpreterManager.java:415)
at org.python.pydev.ui.interpreters.JythonInterpreterManager.doCreateInterpreterInfo(JythonInterpreterManager.java:77)
at org.python.pydev.ui.interpreters.JythonInterpreterManager.internalCreateInterpreterInfo(JythonInterpreterManager.java:46)
at org.python.pydev.ui.interpreters.AbstractInterpreterManager.createInterpreterInfo(AbstractInterpreterManager.java:369)
at org.python.pydev.ui.pythonpathconf.ObtainInterpreterInfoOperation.run(ObtainInterpreterInfoOperation.java:81)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Jruby 已经安装好了,它的版本是:
panton@maleficio:~$ dpkg -l |grep -i jruby
ii jruby 1.5.6-2 Ruby 的 100% 纯 Java 实现
并且 jar 文件 /usr/lib/jruby/lib/jruby.jar 存在并包含两个错误转储中引用的类。
根据要求,我执行以下命令:
~$ java -Dpython.home=/usr/share/java -classpath /usr/share/java/jython-2.5.1.jar:$CLASSPATH org.python.util.jython plugins/在 org.python.core.PySystemState.getPathLazy(PySystemState.java:502) 在 org.python.core.PySystemState.getPath(PySystemState.java:513) 在 org.python.core.PySystemState.getPathLazy(PySystemState.java:502) 在 org.python.pydev/pysrc/interpreterInfo.py 错误导入站点.python.core.util.RelativeFile.(RelativeFile.java:21) 在 org.python.core.packagecache.PathPackageManager.packageExists(PathPackageManager.java:43) 在 org.python.core.packagecache.SysPackageManager.packageExists(SysPackageManager. java:153) 在 org.python.core.PyJavaPackage。在 org.python.core.PyObject 中找到 attr_ex (PyJavaPackage.java:132)。查找属性(PyObject.java:869) 在 org.python.core.org.python.core.JavaImporter.find_module(JavaImporter.java:39) 在 org.python.core.packagecache.PackageManager.lookupName(PackageManager.java:136)。 JavaImporter.find_module(JavaImporter.java:25) 在 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 在 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 在 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java: 43) 在 java.lang.reflect.Method.invoke(Method.java:616)
java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: org/jruby/ext/posix/util/Platform
欢迎对此提供任何帮助。