MyEclipse 6 Java EE 开发中文手册
MyEclipse 6 Java EE 开发中文手册
2007 年 12 月
刘长炯 著
- 1 -
- 2 -
MyEclipse 6 Java EE 开发中文手册
献给我最爱的父母!
感谢
MyEclipse 6 Java EE 开发中文手册
- 3 -
It’s al of you, who makes me a super No. 1, thank you !
感谢 Michael Jackson 奉献好听的歌舞!
感谢所有鼓励我的好朋友们!
目 录
MyEclipse 6 Java EE 开发中文手册
MyEclipse 6 Java EE 开发中文手册 ...................................................................................1
目 录.............................................................................................................................4
介 绍 ....................................................................................................................................7
文档说明 .......................................................................................................................7
适用的读者....................................................................................................................7
关于作者 .......................................................................................................................7
版权声明 .......................................................................................................................7
第一章
安装配置开发环境 ..........................................................................................9
JDK 的下载,安装和配置(可选)..............................................................................9
下载 JDK................................................................................................................9
安装 JDK..............................................................................................................12
配置环境变量(可选) ........................................................................................13
JDK 6 中文文档下载地址(ZIP,HTML,CHM)(可选) .........................................15
Tomcat 服务器的下载,安装和运行(可选)..................................................................16
JBoss 服务器的下载,安装和运行(可选)..............................................................18
MySQL 5 数据库服务器下载,安装和运行(可选) ..................................................21
MySQL 5 官方版本的下载和安装,运行 ............................................................21
MySQL 5 绿色版的下载安装和运行.....................................................................22
下载 ..............................................................................................................22
用法图解.......................................................................................................23
Eclipse 3.3 的下载,安装和运行 ................................................................................25
MyEclipse 6 的下载,安装和运行...............................................................................26
下载 .....................................................................................................................27
安装 .....................................................................................................................28
ALL in ONE 版本的安装 ..............................................................................28
插件(PLUG-IN) 版本的安装 ....................................................................29
运行 .....................................................................................................................29
小结.............................................................................................................................30
第二章 开发第一个 Java 应用程序 ....................................................................................31
介绍.............................................................................................................................31
手工编写,编译并运行 Java 程序...............................................................................31
使用 Eclipse/MyEclipse 来编写,编译并运行 Java 程序............................................32
小结.............................................................................................................................35
第三章 Eclipse 的基础概念,配置和使用.........................................................................36
界面布局 .....................................................................................................................36
菜单 .....................................................................................................................36
工具栏..................................................................................................................36
透视图(Perspective)切换器 ............................................................................37
视图(View) ......................................................................................................38
上下文菜单(Context Menu) ............................................................................40
状态栏(Status Bar)..........................................................................................40
- 4 -
MyEclipse 6 Java EE 开发中文手册
编辑器(Editor).................................................................................................40
常见概念和操作 ..........................................................................................................41
项目(Project)........................................................................................................41
工作区(Workspace) .............................................................................................41
导入、导出 Java 项目..........................................................................................41
导入项目.......................................................................................................41
导出项目.......................................................................................................42
快速修正代码错误................................................................................................42
优化导入列表.......................................................................................................43
添加,修改,删除 JRE........................................................................................43
查看类定义,层次和源码.....................................................................................43
查找类文件(Open Type) .................................................................................44
源码目录,输出路径,Library 和编译器版本设置 ...............................................44
生成 getter 和 setter 方法 ...................................................................................45
格式化源代码.......................................................................................................46
注释和取消注释 ...................................................................................................46
手工和自动编译 ...................................................................................................46
直接粘贴 Java 源码为类文件...............................................................................46
复制项目中的文件................................................................................................46
断点和调试器.......................................................................................................47
快速加入、删除 jar 包到 Build Path ....................................................................48
查看当前类被哪些类引用.....................................................................................48
设置编辑器字体,颜色和显示行号 ......................................................................48
Link 文件..............................................................................................................49
安装插件 ..............................................................................................................50
获取帮助和阅读帮助文档.....................................................................................50
CVS 团队源代码管理(在线阅读).....................................................................50
小结.............................................................................................................................50
第四章 用 MyEclipse Database Explorer 管理数据库 .......................................................51
功能一览 .....................................................................................................................51
使用 MyEclipse Database Explorer 透视图 ................................................................53
介绍 .....................................................................................................................53
连接到 MyEcipse Derby 数据库 ..........................................................................54
切换到 MyEclipse Database Explorer 透视图 .....................................................54
打开数据库连接 ...................................................................................................55
关闭数据库连接 ...................................................................................................56
浏览数据库结构 ...................................................................................................56
编辑和执行 SQL 代码段 ......................................................................................57
生成实体关系(ER)图.......................................................................................59
编辑表格数据.......................................................................................................60
清空表格数据.......................................................................................................61
创建和删除表格 ...................................................................................................61
创建和删除外键 ...................................................................................................62
创建和删除索引 ...................................................................................................63
- 5 -