IntelliJ doesnt System.out.println() cyrilic in java on windows
已回答
Hello, I am writing a program and for debugging purposes I use System.out.println(), and instead of Cyrillic "Понеделник", it prints ?????????? . I tried changing encoding in file/settings/editor/file encoding to UTF-8, as well as the encoding in file/settings/editor/general/console/Default encoding, but it doesn't work. I've also tried with Windows-1251, but it also doesn't work. I've seen a friend of mine print out Cyrillic in IntelliJ in java, so it is possible, but I can't find how. Any ideas?
请先登录再写评论。
Please click on Help | Edit Custom VM Options... and add (restart IDE is needed):
It didn't work.
Please provide screenshots from Settings/Preferences | Editor | File Encodings and Settings/Preferences | Editor | General | Console and prepare a small project sample reproducing the issue.
The files can be uploaded at https://uploads.jetbrains.com (do not forget to specify the UploadID)
I uploaded the files. I also included a screenshot(problem.png) of what the problem looks like on my pc. The UploadID is 2022_04_19_86oZoBgogZdXrfgF
Unfortunately, I cannot reproduce the problem. Please try using another JDK for running the project and launch the IDE with default settings. (File | Manage IDE Settings | Restore Default Settings...)
Changing the JDK worked. Thank you !!!
As Egor Klepikov suggested I tried changing JDK on the earlier version (17th instead of 18th) and it worked for me. Setting VM options didn't help me either. Still confused whether this issue relates to IDEAJ or the JDK itself. If additional details would help Egor to reproduce the problem: Windows 11 with default display language set to English (United States), which cannot be changed to Russian due to my Win11 version. Maybe this causes collisions when printing out in Cyrillic. By the way when compiling and running a .class via Windows terminal I got correct Cyrillic outputs on JDK 18.0.1.1.
Anton JDK 18 has made some changes to the encoding, and IDEA does not support it now, so there is a problem with the encoding when outputting: https://youtrack.jetbrains.com/issue/IDEA-291006 Please vote and follow it for further updates.
Please try as a workaround to set encoding for the file specifically in File | Settings | Editor | File Encodings settings: https://youtrack.jetbrains.com/issue/IDEA-291006/Running-the-Java-project-by-using-the-JDK-18-prints-the-garbled-#focus=Comments-27-5944753.0-0 and then rebuild the project. Try also the
windows-1251encoding.