如何使用Jython / PyDev修复Eclipse Kepler / Luna中的UnsupportedCharsetException? [英] How do I fix UnsupportedCharsetException in Eclipse Kepler/Luna with Jython/PyDev?

查看:271
本文介绍了如何使用Jython / PyDev修复Eclipse Kepler / Luna中的UnsupportedCharsetException?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

示例代码:

from java.lang import System

if __name__ == '__main__':
    [System.out.print(x) for x in "Python-powered Java Hello World from within a List-Comprehension."]

烦人的输出:

console: Failed to install 'org.python.util.JLineConsole': java.nio.charset.UnsupportedCharsetException: cp0.
console: Failed to install 'org.python.util.JLineConsole': java.nio.charset.UnsupportedCharsetException: cp0.
Python-powered Java Hello World from within a List-Comprehension.

我已经尝试了所描述的解决方案此处这里。两个解决方案都失败了(我已经将-Dpython.console.encoding = UTF-8参数添加到JVM和PyDev交互式控制台)。

I've tried the solution described here and here. Both solutions failed miserably (I've added the -Dpython.console.encoding=UTF-8 argument to the JVM and the PyDev interactive console).

从4个月前开始,这里还有另外一个问题,没有人回答。那么,我该如何解决呢?

There's also another question about it here from 4 months ago, and no one answered it. So, how do I fix it?

编辑:我刚刚安装了新的Eclipse Luna,用Jython安装了PyDev,同样的事情发生了。

I've just installed the new Eclipse Luna, installed PyDev with Jython, and the same thing happens.

推荐答案

我已经通过将Jython从2.7.0降级到2.5.4rc1来解决了这个问题。这似乎是使用Jython 2.7.0的Python 3.4的一个问题。

I've fixed the problem by downgrading Jython from 2.7.0 to 2.5.4rc1. It seems to be an issue of Python 3.4 with Jython 2.7.0.

所以,我已经下载了 Jython 2.5.4rc1 - Standalone Jar ,并在Eclipse Luna上手动更改了Jython解释器:Window - > Preferences - > PyDev - > Interpreters - > Jython Interpreter - >删除当前的Jython Interpreter - > New Button(添加下载的独立.jar)。

So, I've downloaded the Jython 2.5.4rc1 - Standalone Jar, and changed the Jython interpreter manually on Eclipse Luna by going: Window -> Preferences -> PyDev -> Interpreters -> Jython Interpreter -> Removing the current Jython Interpreter -> New Button (Adding the downloaded standalone .jar).

现在我们必须等待,看看Jython bug是否会消失Jython的下一个版本(也许它不是Python 3.4的问题,但是Eclipse本身存在问题。在所有情况下,我都使用Kepler和Luna进行测试,并且错误仍然存​​在。我没有使用Python 2.7进行测试,所以我不知道。)

Now we have to wait to see if the Jython bug will go away on the next version of Jython (Perhaps it's not an issue of Python 3.4, but an issue with Eclipse itself. In all cases, I've test both with Kepler and Luna, and the error persisted. I did not test with Python 2.7, so I don't know).

案件结案。

这篇关于如何使用Jython / PyDev修复Eclipse Kepler / Luna中的UnsupportedCharsetException?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆