eclipse 常用 设置.docx

上传人:b****2 文档编号:24516754 上传时间:2023-05-28 格式:DOCX 页数:15 大小:488.87KB
下载 相关 举报
eclipse 常用 设置.docx_第1页
第1页 / 共15页
eclipse 常用 设置.docx_第2页
第2页 / 共15页
eclipse 常用 设置.docx_第3页
第3页 / 共15页
eclipse 常用 设置.docx_第4页
第4页 / 共15页
eclipse 常用 设置.docx_第5页
第5页 / 共15页
点击查看更多>>
下载资源
资源描述

eclipse 常用 设置.docx

《eclipse 常用 设置.docx》由会员分享,可在线阅读,更多相关《eclipse 常用 设置.docx(15页珍藏版)》请在冰豆网上搜索。

eclipse 常用 设置.docx

eclipse常用设置

1,设置默认的全局JRE:

 

Window->Preferences->Java->InstalledJREs,这样每次新建项目时,默认的JRE库即为选中的项。

 

 

2,设置工作空间全局编码:

 

设置UTF-8  Window->Preferences->General->Workspace中Textfileencoding选择other并选UTF-8 

 

3,修改文件默认编码:

 

Window->Preferences->General->ContentTypes 

【注意是修改最下面的Defaultencoding】,在这里可以将html、properties和jsp文件的编码都改成UTF-8的。

 

这样修改后,以后每次新建properties并保存时,就不会跳出一个对话框说你现在的编码是ISO-8859-1的提示了。

 

 

4,修改特定文件的编码:

 

Window->Preferences->MyEclipse->FilesandEditors->JSP 

比如这里修改JSP的页面显示编码为UTF-8,那么每次新建一个jsp文件后,第一行的编码设置内容就会像这样所示:

 

<%@pagelanguage="java"import="java.util.*"pageEncoding="UTF-8"%> 

 

5,设置字体:

 

Window->Preferences->General->Appearance->ColorsandFonts->Basic->Textfont 

 

6,设置文件默认编辑器:

 

Window->Preferences->General-> Editors->FileAssociations 

 

7,设置当鼠标移到文字上时的事件:

这里选择快速显示注释。

 

Window->Preferences->General-> Editors->TextEditors->Whenmousemovedintohover. 

 

8,设置快捷键:

 

Window->Preferences->General->Keys 

输入要设置的动作的名称,比如这里输入“runjava”进行过滤,然后在Binding选项中设置快捷键。

 

这样以后每次要运行java程序时,只需要按Alt+X快捷键就可以了。

 

 

9,禁用启动时不需要的插件:

 

Window->Preferences->General->StartUpandShutdown 

比如MyeclipseDerby,老是在Server控制台占着茅坑不拉屎,看着蛋疼,先把它给治了。

 

 

10,设置注册码:

 

Window->Preferences->MyEclipse->Subscription 

 

11,增强Eclipse的自动代码提示功能(摘自网络):

 

   默认下,只有按"."或"Alt+/"才出现代码提示功能,不够强大,作小小设置,可将代码提示功能像VS的一样方便 

   1.Window->Preferences->Java->Editor->ContentAssist 

   2.将"AutoActivationtriggersforjava"设置为".abc"(默认是"."),点"Apply"应用 

   3.导出目前的Eclipse配置文件:

File->Export->General->Perferences,选择保存路径,保存得到*.epf文件 

   4.用文本编辑器打开刚才保存的*.epf文件,搜索".abc",将".abc"部分改为 

       ".abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ(,"(以上为自动提示的触发字符, 

       根据个人习惯设置),保存此配置文件(个人觉得不太好用,容易出错) 

   5.导入此配置文件:

File->import->General->Perferences,导入修改后的配置文件. 

12,关闭自动更新:

 

Myeclipse有时一打开就在Progress中无休止地更新,必须把它给做了。

 

1.window-->preferences-->General-->StartupandShutdown, 

去掉"AutomaticUpdatesScheduler"项前面的勾。

 

2.Window-->Preferences-->MyeclipseEnterpriseWorkbench-->Maven4Myeclipse-->Maven-->"Downloadrepositoryindexupdatesonstartup",去掉前面的勾。

 

 

 

使用Eclipse一段时间了,不断的在磨合,在调试到自己喜欢的编辑环境。

这里写上自己常用的的一些小技巧,方便以后换机器,换编译环境的时候设置。

同时也希望给大家一些帮助。

一些非常常用的就不说了,什么F2,F3,Ctrl+shift+...等等的就不说了。

删除当前行:

ctrl+D

移动选中的N行代码:

ctrl+Alt+↑ctrl+Alt+↓

复制选中的N行代码:

ctrl+Alt+↑ctrl+Alt+↓

设置选中的代码大小写:

小写改成大写:

ctrl+shift+Y大写改成小写:

ctrl+shift+X

颜色设置:

设置背景色:

1、打开window->Preference,弹出Preference面板

2、展开General标签,选中Editors选项,展开。

3、选中TextEditors,右边出现TextEditors面板。

面板中有这样一个选项:

Appearancecoloroptions;其中是各种板块颜色的设置,其中有一项是backgroundcolor,根据自己的喜好选择颜色。

4、选中backgroundcolor,勾掉SystemDefault,点击'color',弹出颜色选择面板,选择喜好的颜色,单击确定。

5、返回TextEditors,单击Apply即可。

设置设置高亮显示的颜色:

1、Window-->preferences-->General-->Editors-->TextEditors-->Annotations-->右边选择点击Occurrences-->设置Color

2、Window-->preferences-->Java-->Editor-->MarkOccurrences"复选框勾选

 

 

 

在workspace的目录中,找到 .metadata/.plugins/org.eclipse.core.runtime/.settings/ 目录,然后把两个文件给替换一下就可以了。

 

对了,替换完之后还得手动设置一次字体。

我是用Consolas14pts的 

org.eclipse.jdt.ui.prefs 

#WedDec2314:

31:

26CST2009

secondaryIPColor=45,70,56

AbstractTextEditor.Color.Background=25,25,25

eclipse.preferences.version=1

spacesForTabs=true

writeOccurrenceIndicationColor=61,63,37

AbstractTextEditor.Color.Foreground.SystemDefault=false

AbstractTextEditor.Color.Foreground=128,255,0

AbstractTextEditor.Color.SelectionBackground=65,76,59

currentIPColor=45,70,56

overviewRuler_migration=migrated_3.1

lineNumberRuler=true

deletionIndicationColor=255,0,0

searchResultIndicationColor=51,51,79

currentLineColor=34,34,32

AbstractTextEditor.Color.SelectionForeground=255,255,255

printMarginColor=192,192,192

occurrenceIndicationColor=72,72,72

AbstractTextEditor.Color.SelectionBackground.SystemDefault=false

AbstractTextEditor.Color.Background.SystemDefault=false

lineNumberColor=0,128,192

AbstractTextEditor.Color.FindScope=25,25,25

AbstractTextEditor.Color.SelectionForeground.SystemDefault=false

org.eclipse.ui.editors.prefs 

#SunMar2122:

41:

48CST2010

pf_coloring_argument=128,255,0

sp_cleanup.remove_private_constructors=true

semanticHighlighting.methodDeclarationName.enabled=true

sp_cleanup.sort_members_all=false

sp_cleanup.format_source_code=false

sp_cleanup.never_use_blocks=false

semanticHighlighting.enum.enabled=true

sp_cleanup.remove_unused_private_members=false

sp_cleanup.use_this_for_non_static_field_access=false

sp_cleanup.remove_unnecessary_casts=true

org.eclipse.jdt.ui.text.code_templates_migrated=true

pf_coloring_key=255,200,0

sp_cleanup.add_missing_nls_tags=false

semanticHighlighting.localVariableDeclaration.enabled=true

semanticHighlighting.interface.enabled=true

sp_cleanup.remove_trailing_whitespaces=false

content_assist_autoactivation_triggers_java=.abcdefghijklmnopqrstuvwxyz

semanticHighlighting.inheritedMethodInvocation.color=227,183,53

sp_cleanup.always_use_blocks=true

sp_cleanup.add_missing_methods=false

LexicalSortingAction.isChecked=true

semanticHighlighting.typeParameter.color=205,177,173

org.eclipse.jdt.ui.editor.tab.width=

sp_cleanup.always_use_this_for_non_static_field_access=false

sp_cleanup.never_use_parentheses_in_expressions=true

breadcrumb.org.eclipse.jdt.ui.JavaPerspective=true

sourceHoverBackgroundColor=255,255,225

java_keyword_return=236,108,30

org.eclipse.pde.ui.ExternalPluginLibrariesFilter1=true

spelling_user_dictionary_encoding=

spelling_locale_initialized=true

org.eclipse.jdt.ui.text.custom_templates=

xmlversion\="1.0"encoding\="UTF-8"standalone\="no"?

>

org.eclipse.jdt.ui.PackageExplorer_patternFilterId_.*=true

content_assist_proposals_background=255,255,255

semanticHighlighting.method.color=247,197,39

semanticHighlighting.interface.color=255,128,128

semanticHighlighting.method.enabled=true

sp_cleanup.make_variable_declarations_final=true

org.eclipse.jdt.ui.PackageExplorer_patternFilterId_RemoteSystemsTempFiles=true

sp_cleanup.on_save_use_additional_actions=false

sp_cleanup.remove_unnecessary_nls_tags=false

org.eclipse.jdt.ui.overrideannotation=true

org.eclipse.jdt.ui.text.templates_migrated=true

content_assist_parameters_foreground=230,230,230

spelling_ignore_non_letters=true

java_string=89,196,196

spelling_ignore_digits=true

semanticHighlighting.parameterVariable.enabled=true

org.eclipse.jdt.ui.javadoclocations.migrated=true

java_doc_tag=64,149,108

semanticHighlighting.staticMethodInvocation.color=255,255,255

org.eclipse.jdt.internal.ui.PackageExplorer.HideInnerClassFilesFilter=true

spelling_ignore_single_letters=true

CustomFiltersActionGroup.org.eclipse.jdt.ui.PackageExplorer.TAG_DUMMY_TO_TEST_EXISTENCE=storedViewPreferences

hoverModifierMasks=org.eclipse.jdt.ui.BestMatchHover;0;org.eclipse.jdt.internal.debug.ui.JavaDebugHover;0;org.eclipse.jdt.ui.ProblemHover;0;org.eclipse.jdt.ui.NLSStringHover;327680;org.eclipse.jdt.ui.JavadocHover;0;org.eclipse.jdt.ui.JavaSourceHover;131072;org.eclipse.jdt.ui.AnnotationHover;0;

sp_cleanup.convert_to_enhanced_for_loop=false

sp_cleanup.always_use_parentheses_in_expressions=false

sp_cleanup.use_parentheses_in_expressions=false

pf_coloring_assignment=255,255,255

sp_cleanup.remove_unused_private_methods=true

semanticHighlighting.class.color=255,128,192

sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true

sp_cleanup.always_use_this_for_non_static_method_access=false

tabWidthPropagated=true

java_comment_task_tag=64,128,128

sp_cleanup.qualify_static_method_accesses_with_declaring_class=false

org.eclipse.jdt.ui.PackageExplorer.PackageDeclarationFilter=true

semanticHighlighting.deprecatedMember.color=255,255,255

sp_cleanup.add_default_serial_version_id=true

org.eclipse.jdt.ui.PackageExplorer.ImportDeclarationFilter=true

sp_cleanup.make_private_fields_final=true

java_doc_link=0,128,255

org.eclipse.jdt.ui.PackageExplorer_patternFilterId_RemoteSystemsConnections=true

sp_cleanup.add_serial_version_id=false

sp_cleanup.add_missing_deprecated_annotations=true

spelling_ignore_urls=true

semanticHighlighting.annotation.color=192,192,192

pf_coloring_value=255,255,255

semanticHighlighting.typeArgument.enabled=true

semanticHighlighting.abstractMethodInvocation.color=241,196,54

sp_cleanup.add_missing_annotations=true

org.eclipse.jdt.ui.gettersetter.use.is=true

org.eclipse.jdt.ui.text.custom_code_templates=

xmlversion\="1.0"encoding\="UTF-8"standalone\="no"?

>

lastRecentlyUsedFilters=org.eclipse.jdt.internal.ui.PackageExplorer.EmptyInnerPackageFilter,

spelling_ignore_mixed=true

semanticHighlighting.staticField.color=255,255,255

org.eclipse.jface.textfont=1|Consolas|14.25|0|WINDOWS|1|-19|0|0|0|400|0|0|0|0|3|2|1|49|Consolas;

sp_cleanup.add_missing_override_annotations=true

sp_cleanup.remove_unused_private_types=true

sp_cleanup.organize_imports=true

semanticHighlighting.typeParameter.enabled=true

sp_cleanup.remove_unused_imports=false

semanticHighlighting.staticFinalField.color=128,255,0

semanticHighlighting.abstractMethodInvocation.enabled=true

sp_cleanup.add_generated_serial_version_id=false

semanticHighlighting.localVariable.color=70,140,179

sp_cleanup.qualify_static_member_accesses_with_declaring_class=false

sp_cleanup.use_this_for_non_static_method_access=false

content_assist_parameters_background=0,0,0

sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true

content_assist_disabled_computers=org.eclipse.jdt.ui.javaAllProposalCategory\u0000org.eclipse.jdt.ui.javaNoTypeProposalCategory\u0000org.eclipse.jdt.ui.textProposalCategory\u0000org.eclipse.jdt.ui.javaTypeProposalCategory\u0000

semanticHighlighting.inheritedMethodInvocation.enabled=true

sp_cleanup.make_local_variable_final=false

sp_cleanup.remove_trailing_whitespaces_all=true

java_multi_line_comment=0,128,64

semanticHighlighting.parameterVariable.color=64,128,0

sp_cleanup.format_source_code_changes_only=false

sp_c

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 成人教育 > 成考

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1