Eclipse is an open source, Java-based extensible development platform. At present, many developers will choose to use Eclipse development time, many beginners just getting started with Java using Eclipse also from the beginning. This blog introduces the Eclipse installation and configuration.
Some people new to Java may have heard MyEclipse, here it is simple to explain some of the similarities and differences between Eclipse.
MyEclipse, is coupled with a strong own plug-ins developed with the enterprise-wide integrated development environment based on the eclipse, mainly for the development of Java, Java EE, and mobile applications. MyEclipse is very powerful, very wide support, especially quite good to support a variety of open source products, it is an extension of Eclipse.
On the last function, since MyEclipse provides a wealth of plug-ins, more convenient to use, easy to develop enterprise-level applications; and Eclipse will need to use their own import and configure the appropriate plug-in to use the correlation function in the actual development process . But on early learning, there is no much difference between the two, are able to meet the basic needs of Java developers.
There is a big difference between the two is that Eclipse is free to use, and MyEclipse is billing software (of course in the country charge for the use of you know (͡ ° ͜ʖ ͡ °)).
In fact, at the beginning of the study do not have to tangle in the use of which is good, usually use one after another'll get it, because these two software interface and features are very similar.
table of Contents:
Download and install the Eclipse
Frequently Asked Questions for Eclipse
Download and install the Eclipse
Eclipse Download
You first need to download the Eclipse official website resources, Eclipse installation is divided into two types:
1, after installation download .zip decompression directly
2, after downloading Installer tool to install
Direct Baidu search 'Eclipse downloads', or click ☛ Portal
Installer Tool
extract the .zip package
For different situations, development tools developed for different scenarios, Java developers are usually two
Eclipse IDE for Eclipse Committers是社区版,Eclipse IDE for Enterprise java Developers是企业版,企业版包含社区版的内容,后期开发Java WEB也比较方便,建议下载第一个企业版的
Eclipse安装
Installer工具包方式安装Eclipse比解压版复杂一些,建议初学者直接下载解压包版的,此处不再详细介绍Eclipse installer方式安装,可百度自行搜索。☛传送门
⚘ 将 Eclipse 解压或安装到没有中文且没有空格的路径下
⚘ 将 Eclipse创建快捷方式复制到桌面或底部任务栏
⚘设置 workspace
首次启动,选择指定的工作空间(workspace),用于存放 java 代码,点击ok,第二次启动之后是Launch
注:Use this as the default and do not ask again不建议打钩.如果打钩,每次 Eclipse 会自动进入上面选中的workspace 中.不利于 Eclipse 开启其他 workspace,workspace是可以随意更换的
⚘首页面显示
Eclipse的基本设置
Eclipse透视图设置
所谓透视图,即在进入Eclipse时显示的界面。
Eclipse默认的透视图是Java EE,鼠标悬停在紫色部分可以看到,-如果不是点击红色部分选择JavaEE。
选择透视图要显示的结构
⚘ 经常要显示的结构有:
package Explorer
Navigator
Outline
Console
根据自己的习惯去选用这些结构,不用可以叉掉,这些结构也可以拖动
设置编码集
点击Window下的Preferences
在General下的Workspace中选择UTF-8编码格式(UTF-8编码集应用更广广泛)
设置字体样式
根据个人喜好设置字体样式
设置右键:new 下显示的结构
点击进入:
从子列表中选择常用的结构即可,常用的有:
Java Project, Package,Class, Interface, Enum, JUnit Test Case, Enterprise Application Project, Application Client Project, Connector Project, Web Service, Folder, File, Static Web Project, JSP File, Dynamic Web Project, Servlet, Filter, XML File
保存当前透视图设置/重载透视图设置
覆盖默认的透视图即可
设置eclipse代码自动提示功能
在Auto activation trigers for Java中输入:
.abcdefghijklmnopqrstuvwxyz0123456789
展示效果:
eclipse设置代码注释
编写格式时输入&会自动弹出选项
展示效果:
Files:文件(Files)注释标签,对新建的文件的说明
Types:类型(Types)注释标签,类的注释,对class的说明
Fields:字段注释标签,Fields标签是对变量字段的说明
Constructors:构造函数标签,对类的构造函数的说明
Methods:对函数方法的说明
Overriding Methods:对覆盖方法的说明
Delegate Methods:代表方法标签
Getters:getter方法标签
Setters:setter方法标签
Eclipse快捷键
序号 | 说明 | 快捷键 |
---|---|---|
1 | 补全代码的声明 | alt + / |
2 | 快速修复 | ctrl + 1 |
3 | 批量导包 | ctrl + shift + o |
4 | 使用单行注释 | ctrl + / |
5 | 使用多行注释 | ctrl + shift + / |
6 | 取消多行注释 | ctrl + shift + \ |
7 | 复制指定行的代码 | ctrl + alt + down 或 ctrl + alt + up |
8 | 删除指定行的代码 | ctrl + d |
9 | 上下移动代码 | alt + up 或 alt + down |
10 | 切换到下一行代码空位 | shift + enter |
11 | .切换到上一行代码空位 | ctrl + shift + enter |
12 | 如何查看源码 | ctrl + 选中指定的结构 或 ctrl + shift + t |
13 | 退回到前一个编辑的页面 | alt + left |
14 | 进入到下一个编辑的页面 | alt + right |
15 | 光标选中指定的类,查看继承树结构 | ctrl + t |
16 | 复制代码 | ctrl + c |
17 | 撤销 | ctrl + z |
18 | 反撤销 | ctrl + y |
19 | 剪切 | ctrl + x |
20 | 粘贴 | ctrl + v |
21 | 保存 | ctrl + s |
22 | 全选 | ctrl + a |
23 | 格式化代码 | ctrl + shift + f |
24 | 选中数行,整体往后移动 | tab |
25 | 选中数行,整体往前移动 | shift + tab |
26 | 在当前类中,显示类结构,并支持搜索指定的方法、属性 | ctrl + o |
27 | 批量修改指定的变量名、方法名、类名等 | alt + shift + r |
28 | 选中的结构的大小写的切换,变成大写 | ctrl + shift + x |
29 | 选中的结构的大小写的切换,变成小写 | ctrl + shift + y |
30 | 调出生成 getter/setter/构造器等结构 | alt + shift + s |
31 | 显示当前选择资源(工程 or 文件)的属性 | alt + enter |
32 | 快速查找:参照选中的 Word 快速定位到下一个 | ctrl + k |
33 | 关闭当前窗口 | ctrl + w |
34 | 关闭所有的窗口 | ctrl + shift + w |
35 | 查看指定的结构使用过的地方 | ctrl + alt + g |
36 | 查找与替换 | ctrl + f |
37 | 最大化当前的 View | ctrl + m |
38 | 直接定位到当前行的首位 | home |
39 | 直接定位到当前行的末位 | end |
使用Eclipse的常见问题
双击 Eclipse 启动 图标,不能正常启动 Eclipse
启动不了的原因有很多种,这里需要大家从如下几个方面排查:
1. The environment variable is correctly configured, need to be checked at the command line or java.exe javac.exe
2. correctly installed JDK and JRE
3. The installation of the JDK version (32-bit or 64-bit), version must be consistent with Eclipse
eclipse.ini modified configuration file 4. Eclipse installation directory
Entering Eclipse, there is no alternative workspace
The reason: When you start, check the Use this as the default and not ask again
Solution:
In the windows - Under Preferences, you can check the above red box
Import existing projects
This blog and CSDN blog (ཌ ་.Asio Jun ་. ད) simultaneous release