执行JAVA程序报错内容如下:

java.lang.IllegalStateException: The Java Virtual Machine has not been configured to use the desired default character encoding (UTF-8).

经查,是因为在windows中安装的jdk默认编码格式是GBK,需要修改为utf-8.在系统中添加系统变量

变量名:JAVA_TOOL_OPTIONS

变量值:-Dfile.encoding=UTF-8

 

重启Eclipse即可(一定要重启,否则不生效)

相关文章:

  • 2021-05-17
  • 2022-01-09
  • 2021-10-21
  • 2021-09-06
  • 2021-05-14
  • 2022-02-08
  • 2021-11-05
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-14
  • 2021-04-18
  • 2021-08-11
  • 2021-11-28
  • 2021-05-20
相关资源
相似解决方案