优化 Eclipse
- General > Startup and Shutdown : 移除所有在启动时加载的插件。
- General > Editors > Text Editors > Spelling : 关闭拼写检查。
-(可选的)Install/Update > Automatic Updates > 取消勾选“Automatically find new updates and notify me”。
-(可选的)将 JDK 放到内存,大约 300MB。 - 注释中写点带格式的文字,format后全乱了,解决办法如下:Windows -> Preferces -> Java -> Code Style -> Formatter -> Edit -> Comments 取消勾选“Enable Javadoc comment formatting”.
- 设置 Author:在window -> preference -> java -> code typle -> code template ->
设置工作空间 workspace
设置工作空间编码 UTF-8
编译 war 时注意
导出 war 时会把多余的 *.svn 也打包进去。我们不希望这样,于是设置 Eclipse 忽略 *.svn。设置如下:
Enter the project properties > Resource > Resource Filters > Add… > Exclude All > Files and Folders > All children (recursive) > Name matches *.svn > OK.
指定 VM 启动
创建 exe 的快捷方式,加上参数 eclipse -vm "c:\jdk6u22\jre\bin\javaw"
https://blog.youkuaiyun.com/weixin_34146410/article/details/86010651
Eclipse Maven 转换失败
在 .classapth 中加入
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
快速添加注释时指定作者名
找到 eclipse.ini,打开编辑最后添加一句:-Duser.name=Jason
代码格式化
换行宽度设置
java---code style ---formatter
首先新建一个,如 zxm。因为 eclipse 自带的不能编辑
编辑,在 tab 的 Line Wrapping 设置 最大的 line width 即可。默认为 80.这样以后代码自动格式化时不会给换行了。
XML 的也是
局部忽略格式化
@formatter:off 开启关闭格式化,@formatter:on 重新开启格式化
配置搜索 Java--Formatter,第一次添加会直接跳入到 Edit 界面,选择 Off/On Tags,勾选 Enable Off/On Tags , 保存即可。
设置 JSP 默认编码 UTF-8
设置外部浏览器打开
配置 Java 反射获取参数名
在 8 以前的 Java 版本的时候,我们利用反射只能获取到参数类型,然后参数名字都是利用 `arg0,arg1,arg2`……所以在使用一些反射编程方面上不是很方便,Java 8 开始新增了这个功能,但是我们正常情况下使用 JVM 不会默认保留参数名字,导致了会出现以下异常:
所以我们如果需要可以自行开启,下面说下 Eclipse 怎么开启 parameters。
在 Eclipse 中设置编译选项:【Window->perferences->java->Compiler】中勾选【Store information about method parameters (usable via reflection)】