How do I fix UnsupportedCharsetException in Eclipse Kepler/Luna with Jython/PyDev?

16,483

Solution 1

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.

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).

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).

Case closed.

Solution 2

I've fixed this issue following the advice mentioned in the bug report you referred to (http://bugs.jython.org/issue2222), adding -Dpython.console.encoding=UTF-8 as a VM argument to the run configuration for my program. Setting the same value as an environment variable for the Jython interpreter didn't work in my case.

I'm using Jython 2.7.0 and Eclipse Luna with PyDev on Windows 7.

Solution 3

Well, I think this isn't really related to PyDev (only Jython)... (you can double check by running it in the command line).

I think what you're seeing is the same thing as the following report at the Jython tracker: http://bugs.jython.org/msg8448

Solution 4

I have installed Python 3.5.2 in Neon eclipse and found the same issue.

Added -Dpython.console.encoding=UTF-8 as a VM argument as mentioned by user826366. I am not seeing any issue now.

Solution 5

add "-Dpython.console.encoding=UTF-8" to the Run Configurations -> VM arguments.

Share:
16,483
Ericson Willians
Author by

Ericson Willians

Updated on July 10, 2022

Comments

  • Ericson Willians
    Ericson Willians almost 2 years

    Example code:

    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."]
    

    Annoying output:

    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.
    

    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).

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

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