首页 > 系统服务 > 详细

【Eclipse/MyEclipse常用设置】

时间:2015-06-19 11:52:59      阅读:124      评论:0      收藏:0      [点我收藏+]

1. eclipse设置

1.1 改变高亮显示字符串的背景色(默认暗灰色)

设置:Window->Preferences->General->Editors->Text Editors->Annotations->Occurrences

1.2 常用快捷键

eclipse中常用快捷键:http://www.open-open.com/bbs/view/1320934157953/

1.3 修改eclipse字符集

  1. 配置workspace的编码格式:windows->Preferences->general->Workspace,右侧Text file encoding,选择Other,改变为GBK;
  2. 配置工程的编码格式:Project->Preferences->Resource->Text file encoding;
  3. 配置java文件的编码格式:windows->Preferences->general->ContentTypes->Java Source File->UTF-8 ==Update;
  4. 做RCP应用的Product输出时、或者插件输出时,则总是出错,要么不能编译通过(输出时要重新compile)、要么输出的插件运行时中文显示乱码。此时需要再RCP应用、或插件Plugin工程的 build.properties中增加一行,javacDefaultEncoding.. = UTF-8。让输出时编译知道java源文件时UTF-8编码。这个设置需要保证所有的java源文件时UTF-8编码格式,如果不全是,可以参考 Eclipse帮中(Plug-in Development Environment Guide > Reference > Feature and Plug-in Build configuration),建议全部java源文件是UTF-8编码。
    参考文档:http://blog.csdn.net/wubai250/article/details/6578784

1.4 删除eclipse中配置的多余的tomcat

设置:preferences–>Server–>Runtime Environment

2. eclipse报错

2.1 代码中remove override annotation或Problems中显示

错误原因:编译环境不匹配导致出错
解决方法:以下三个版本应该要相同

  1. 先看JDK的版本,是否为1.6或以上:preference->java->compiler 下要改成1.6或以上
  2. 项目右键->properties->Java Compiler->改成1.6或以上
  3. 如果是Maven工程:工程右键->properties->project Facets->修改右侧的version 保持一致。设置Maven工程的编译插件版本:

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
            <source>1.7</source>
            <target>1.7</target>
        </configuration>
    </plugin>

参考文档Maven项目管理工具初体验

【Eclipse/MyEclipse常用设置】

原文:http://blog.csdn.net/heweirun_2014/article/details/46559285

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!