Eclipse使用笔记
版权声明:本文可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者署名及本版权声明。
在工作中使用Eclipse有几年了,我写Java程序的主力IDE最初是JBuilder,中间数次切换到Netbeans和IDEA,最后稳定在Eclipse。使用Eclipse的过程中也不时会有bug出现,搞的人很恼火,但总体来说,Eclipse不失为一款伟大的IDE产品,无论在功能上还是构思设计上。在这里记录一些我使用Eclipse的笔记,对Eclipse掌握的越多,就越能体会到”develop with pleasure”。

[Eclipse使用]
Eclipse安装
下载JEE版
设置JRE和Server Runtime
下载插件:CDT/viPlugin/jadclipse等
安装插件:link方式
调整设置
显示行号=General – text editors – line number
去除拼写检查=General – text editors – spelling
字体设置 = General – Appearance – colors and fonts
代码折叠=java – editor – folding
注释格式=java – code style – code templates – comments – type
去掉自动生成的todo=code templates – code
本地历史记录数加大
windows–preference-XDoclet的设置
锁定工具栏
team下ignore resources
修改Windows->Preferences->XML->XML Files->Editor,增加到118字符
Eclipse-java=Window-preference-java-code style-formatter每行增至118字符 (Line wrapping)
屏蔽编译警告
Window -> Preference -> Java -> Compiler -> Error/Warnings -> Generic types -> Unchecked generic type operation : 选Ignore
如果只是想在显示上屏蔽:
在Filters – Description里选doesn’t contain,然后在下面的输入框输入References to generic type 或 generic type或raw type之类的关键字就可以了
帮助中最重要的
提示与技巧
键绑定
代码模板--首选项-java-编辑器-模板
搭建C开发环境
下载Eclipse CDT插件
安装C开发环境
- Download and run the MinGW setup program, MinGW-5.1.3.exe.
- Select download and install the MinGW base tools and the g++ compiler. You may select the Current or Candidate version of these tools. You may also install any of the other available compilers as well.
Do not install the MinGW Make feature as the MSYS version of make from step 5 is a more complete implementation of make. - The MinGW setup program currently does not install the gdb debugger. To install the debugger, download the file from the following location: gdb-6.6.tar.bz2
- Extract the contents of the file gdb-6.6.tar.bz2 to the same location where you installed MinGW.
- If you want to use Makefile projects, download and run the setup program from the following location: MSYS-1.0.10.exe. MSYS provides an implementation of make and related command line tools. This is not required for other types of projects with the MinGW toolchain, which use CDT’s internal build tools to perform the build.
在Eclipse中建立外部make项目,用MSYS中的make,gcc、gdb用MinGW中的
修改build directory为${workspace_loc:/项目名}
Eclipse卸载
1、备份workspace中.metadata文件夹
2、备份myPlugin和links文件夹
3、备份configuration文件夹
4、在Eclipse中导出个人配置
[Eclipse技巧]
Eclipse提速
1.取消系统的自动折叠
操作方法:
Window->Preferences->Java->Editor->Folding tab.
2.关闭不常用的工程。
一些不常用的工程打开的时候,也会影响你正在使用工程的操作速度。
3.设置启动参数
-vmargs -Xverify:none -Xms512M -Xmx1024M -XX:PermSize=128M -XX:MaxPermSize=256M -XX:+UseParallelGC
Tab键设置
UE=高级-设置-编辑器-自动换行/制表符设置
Eclipse-java=Window-preference-java-code style-formatter
Eclipse-text=Window-preference-General-Editors-Text Editors
Eclipse-xml=Window-preference-xml-xml files-Editor
Eclipse-ant=Windows=prefernce-Ant-Editor-Formatter
其他技巧
可以复制粘贴项目
首选项-java-编辑器-代码辅助--补全时填充自变量名
Enter键--字符串回绕
通过从进程或调试目标的上下文菜单中选择属性,可以看到命令行
[Eclipse快捷键]

在Eclipse中使用快捷键能够大大提高工作效率,Eclipse也列出了它的全部快捷键,估计有上百个之多,当然我们在工作中记住常用的1、20个就足够用了。

最新评论