在项目中设置通过maven下载源代码和javadoc,直接通过eclipse浏览源代码时,发现中文为乱码。解决方法如下:

修改Eclipse中文本文件的默认编码:windows->Preferences->general->Workspace->Text file encoding设置为UTF-8;
修改JAVA源文件的默认编码:windows->Preferences->general->Content Types->右侧Context Types树,点开Text,选择Java Source File,在下面的Default encoding输入框中输入UTF-8,点Update;
重启Eclipse即可生效。

相关文章:

  • 2021-11-19
  • 2021-08-03
  • 2021-07-09
  • 2021-10-21
  • 2021-11-23
  • 2021-08-23
猜你喜欢
  • 2021-10-24
  • 2021-10-30
  • 2021-10-27
  • 2021-11-19
  • 2021-04-02
  • 2021-09-21
相关资源
相似解决方案