The question has been raised a million times, I know. And there are a thousand and one answers online. But I could solve it. The bottom line. When I collect an Ant project and type something into the console (in Cyrillic),

System.out.println("привет"); 

works ok. However, when trying to create a maven project and collect them, a bundle of squares / garbage will pop up:

 ""C:\Apache\maven\bin\mvn.bat""             ७           譥  

, ᯮ 塞 ணࠬ 䠩 .

I tried a lot: -Dfile.encoding=UTF8 in windows variables I wrote it, I added it to the NetBeans parameter itself at startup.

In this case, Maven refuses to start me, apparently the system swears at the absence of the file (I guessed it), but how can I make a normal Cyrillic display?

  • I suspect that the console itself works in some kind of cf866, and these are not really maven problems. Although these diamonds, as far as I remember, exist only inside UTF-8 to indicate dead symbols. In general, confirm / deny that chcp within this session returns 65001 or 866. - etki
  • Yes, I also suspect cp866, but how do I know what chcp returns? the only place I can run it is cmd. There, yes, returns 866 - arg
  • How does the maven build happen? I never worked at netbins. There you can stick any analogue ; chcp ; chcp at the end of the command? - etki
  • A ("привет"); what encoding do you write in? - Barmaley
  • utf-8 project encoding. so I write in it. chcp at the end I don’t know how to add :( - arg

1 answer 1

Try adding a command

 chcp 1251 
at the very beginning of the mvn.bat file