1.配置工作空间编码----Window--Preferences--General--Workspace右下方改为UTF-8编码
2.配置各种文件编码----Window--Preferences--General--Content Types点击展开右边Text后依次选中展开各项 在下面Default encoding输入UTF-8 并点击旁边Update
3.配置HTML的文件编码----Window--Preferences界面搜索HTML后选中HTML Files后右下方改为UTF-8编码
4.配置JSP的文件编码(可以消除新建jsp页面时charset pageEncoding等不是UTF-8问题)----方法同3搜索JSP后选中JSP Files更改编码
5.配置字体和颜色----Window--Preferences--Appearance--Colors and Fonts点击展开右边Basic后选中最后一项Text Font后再点击右边Edit按钮(一般字体设置为13)
6.保存java文件时自动格式化代码
windows-->Preferences-->Java --> Editor-->Save Actions, 看到右边的选项了吧,勾选“Perform the selected actions on save
格式化java文件时代码不换行
windows-->Preferences-->Java -->Code Style -->Formatter-->New一个自己的格式--->Line Wrapping--->
1.Maximum line width(改成最大值) 2.Set line width for perview window(改成最大值)---->Commoents--->1.Maximum line width for comments(改成最大值)
格式化css文件时代码不换行
windows-->Preferences-->Web -->CSS Files --> Editor---去掉勾选Insert line break between propeties
7.eclipse打开当前文件所在文件夹方法
Run-->External Tools-->External Tools Configurations...new 一个 program
location 里面填 :C:/WINDOWS/explorer.exe Arguments 里面填: ${container_loc}