Search code examples
javapythonwindowscmdjython

Jython CP720 is not supported in this JVM so it can't be used in python.console.encoding


I want to start using Jython ,I downloaded and installed jython 2.5.2 , i have JDK 1.8 installed and python 3.7 already. After installing jython and following this Tutorial and running this command:

C:\jython2.5.2\bin>jython

I get this output in the CMD , windows 7 32 bit machine

C:\jython2.5.2\bin>jython Jython 2.5.2 (Release_2_5_2:7206, Mar 2 2011, 23:12:06) [Java HotSpot(TM) Client VM (Oracle Corporation)] on java1.8.0_161 Type "help", "copyright", "credits" or "license" for more information. cp720 is not a supported encoding on this JVM, so it can't be used in python.con sole.encoding.

What to do? Edit It was Windows CMD encoding problem, It doesn't accept cp720 so How can I force the CMD to use utf-8 instead for running jython?


Solution

  • Based on How do I fix UnsupportedCharsetException in Eclipse Kepler/Luna with Jython/PyDev? you'll need to pass -Dpython.console.encoding=UTF-8 (or a different character set) on the command line:

    jython -Dpython.console.encoding=UTF-8