eclipse中保存Java文件时出现错误:Save could not be completed. Try File > Save As... if the problem persists.

2023-05-16

一.问题描述

eclipse中保存文件时出现错误:Save could not be completed. Try File > Save As… if the problem persists.
Some characters cannot be mapped using “GBK” character encoding.
Either change the encoding or remove the characters which are not supportedby the “GBK” character encoding.

在这里插入图片描述
翻译:

无法完成保存。尝试文件>另存为。。。如果问题仍然存在。
原因:
某些字符无法使用“GBK”字符编码进行映射。
更改编码或删除“GBK”字符编码不支持的字符。

二.解决方法

点击Save asUTF-8(保存为UTF-8格式),即可成功保存。

三.设置eclipse默认编码的方法

依次点击Window->Profermance->General->Content Type->Text看目录下面的每个文件,包括子目录里面 Default encoding的值是否为utf-8,如果为别的值或为空,则全部改为utf-8,每一项改完,别忘了点一下update.全部改完后退出菜单,再点一下保存,就把整个工作区间设置编码格式改为utf-8了
在这里插入图片描述
注:此种方法对整个工作区间中的所有项目文件有效。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

eclipse中保存Java文件时出现错误:Save could not be completed. Try File > Save As... if the problem persists. 的相关文章

随机推荐