搜档网
当前位置:搜档网 › 安装Eclipse使用说明

安装Eclipse使用说明

安装Eclipse使用说明
安装Eclipse使用说明

Eclipse Tutorial

For Introduction to Java Programming

By Y. Daniel Liang

This supplement covers the following topics:

?Getting Started with Eclipse

?Choosing a Perspective

?Creating a Project

?Creating a Java Program

?Compiling and Running a Java Program

?Run Java Applications from the Command Line

?Debugging in Eclipse

NOTE: To use this supplement with the text, you

may cover Sections 1 – 6 in this supplement

after Chapter 1 in the text, cover Section 7 in

this supplement after Chapter 2 in the text, and

cover Section 8 in this supplement at the

beginning of Chapter 15 in the text.

0 Introduction

This tutorial is for students who are currently taking a Java course that uses Eclipse and for Java programmers who want to develop Java projects using Eclipse. Eclipse is an open source supported by IBM.

You can use JDK command line utility to write Java programs. The JDK command line utility consists of a set of separate programs, such as compiler and interpreter, each of which is invoked from a command line. Besides the JDK command line utility, there are more than a dozen Java development tools on the market today, including Borland JBuilder, NetBeans, Sun ONE Studio (a commercial version of NetBeans), Eclipse, and WebGain Visual Café. These tools support an integrated development environment (IDE) for rapidly developing Java programs. Editing, compiling, building, debugging, and

online help are integrated in one graphical user interface. Using these tools effectively will greatly increase your programming productivity.

This brief tutorial will help you to become familiar

with Eclipse. Specifically, you will learn how to

create projects, create programs, compile, and run

programs.

NOTE: Eclipse can run on any platform with a Java

Virtual Machine. The screen shots in the tutorial

are taken from Windows using Eclipse 3.0. You can

download Eclipse from https://www.sodocs.net/doc/546667509.html,.

INSTALLATION NOTE: You must install JDK 1.5

before installing Eclipse. JDK 1.5 can be

downloaded from

https://www.sodocs.net/doc/546667509.html,/j2se/1.5/download.html. The

Windows version of Eclipse 3.0 is contained in a

ZIP file named eclipse-SDK-3.0-win32.zip. Unzip

the file into c:\. All the files are now

contained in c:\eclipse.

1 Getting Started with Eclipse

Assume that you have installed Eclipse files in c:\eclipse. To start Eclipse, double-click on the eclipse icon in the c:\eclipse folder, as shown in Figure 1. The Workspace Launcher window now appears, as shown in Figure 2. Enter

c:\smith in the Workspace field and click OK to display the Eclipse UI, as shown in Figure 3. (If the workspace already contains projects, the projects will be displayed in the UI.) Workspace is actually a directory that stores your project files.

Figure 1

You can start Eclipse by double-clicking the eclipse

icon from the eclipse installation directory.

Figure 2

The Workspace Launcher lets you choose a directory to

store projects.

Figure 3

The Eclipse main window is the command center for the

IDE.

2 Choosing a Perspective

A perspective defines the initial set and layout of views in the window. Perspectives control what appears in certain menus and toolbars. For example, a Java perspective contains the views that you would commonly use for editing Java

source files, while the Debug perspective contains the views you would use for debugging Java programs. You may switch perspectives, but you need to specify an initial perspective for a workspace.

To create Java programs, set the Java perspective by

choosing Window, Open Perspective, Java from the main menu, as shown in Figure 4. The new UI is shown in Figure 5.

Figure 4

You need to set a perspective for the workspace.

Figure 5

The Eclipse UI is displayed according to the

perspective.

3 Creating a Project

To create a project, choose File, New, Project to display the New Project wizard, as shown in Figure 6. Select Java Project and click Next to display New Java Project wizard, as shown in Figure 7. Type myjavaprograms in the Project name field. As you type, the Directory field becomes

c:\smith\myjavaprograms. Make sure that you selected the options Create project in workspace and Use project folder as root for sources and class files. Click Finish to create the project.

Figure 6

The Eclipse UI is displayed according to the

perspective.

Figure 7

The Eclipse UI is displayed according to the

perspective.

4 Creating a Program

Now you can create a program in the project by choosing

File, New, Class to display the New Java Class wizard, as shown in Figure 8. Type Welcome in the Name field. Check the

option public static void main(String[] args). Click Finish to generate the template for the source code Welcome.java, as shown in Figure 9.

NOTE:

You may use a package by entering a package name

in the Package field in Figure 9. Since the

source code in the book does not use packages,

the Package field is left blank to match the

code in the book.

Figure 8

The New Java Class wizard lets you create a new Java

class.

Figure 9

The New Java Class wizard generates the template of Java source code.

Type System.out.println(“Welcome to Java”); in the main method.

NOTE: As you type, the code completion

assistance may automatically come up to give you

suggestions for completing the code. For

instance, when you type a dot (.) after System

and pause for a second, Eclipse displays a popup

menu with suggestions to complete the code, as

shown in Figure 10. You can then select the

appropriate item from the menu to complete the

code.

Figure 10

The Code Completion popup menu is automatically

displayed to help you complete the code.

5 Compiling and Running a Program

By default, your source code is dynamically compiled as you type. For example, if you forgot to type the semicolon (;)

to end the statement, as shown in Figure 11, you will see

the red wriggly line in the editor pointing to the error. To run the program, right-click the class in the project to display a context menu, as shown in Figure 12. Choose Run, Java Application in the context menu to run the class. The output is displayed in the Console pane, as shown in Figure 13.

Figure 11

Eclipse dynamically checks syntax errors.

Figure 12

You can run the program from Eclipse.

Figure 13

The console pane displays the output to the console.

6 Run Java Applications from the Command Line

You also can run program standalone directly from the operating system. Here are the steps in running the Welcome application from the DOS prompt.

1. Start a DOS window by clicking the Windows Start

button, Programs, MS-DOS Prompt in Windows.

2. Type the following commands to set up the proper

environment variables for running Java programs in the DOS environment in Windows:

set path=%path%;c:\j2sdk1.5\bin

set classpath=.;%classpath%

3.Type cd c:\smith\myjavaprograms to change the directory

to c:\smith\myjavaprograms.

4. Type java Welcome to run the program. A sample run of

the output is shown in Figure 14.

Figure 14

You can run the Java program from the DOS prompt using the java command.

NOTE: You can also compile the program using the

javac command at the DOS prompt, as shown in

Figure 14.

7 Debugging in Eclipse

The debugger utility is integrated in Eclipse. You can pinpoint bugs in your program with the help of the Eclipse debugger without leaving the IDE. The Eclipse debugger enables you to set breakpoints and execute programs line by line. As your program executes, you can watch the values stored in variables, observe which methods are being called, and know what events have occurred in the program.

To demonstrate debugging, Let us use Listing 2.9, ShowCurrentTime.java, to demonstrate debugging. Create a new class named ShowCurrentTime under c:\smith.

7.1 Setting Breakpoints

You can execute a program line by line to trace it, but this is time-consuming if you are debugging a large program. Often, you know that some parts of the program work fine. It makes no sense to trace these parts when you only need to trace the lines of code that are likely to have bugs. In cases of this kind, you can use breakpoints.

A breakpoint is a stop sign placed on a line of source code that tells the debugger to pause when this line is encountered. The debugger executes every line until it encounters a breakpoint, so you can trace the part of the program at the breakpoint. Using the breakpoint, you can quickly move over the sections you know work correctly and concentrate on the sections causing problems.

There are several ways to set a breakpoint on a line. One quick way is to click the cutter of the line on which you want to put a breakpoint. You will see the line highlighted, as shown in Figure 15. You also can set breakpoints by choosing Run, Toggle Line Breakpoint. To remove a

breakpoint, simply click the cutter of the line.

As you debug your program, you can set as many breakpoints as you want, and can remove breakpoints at any time during debugging. The project retains the breakpoints you have set when you exit the project. The breakpoints are restored when you reopen it.

Figure 15

You can set breakpoints in the source code.

7.2 Starting the Debugger

There are several ways to start the debugger. A simple way

is shown below:

1. Set a break point at the first statement in the main

method in the Source Editor.

2. Right-click on ShowCurrentTime.java in the project

pane to display a context menu. Choose Debug, Java

Application to start debugging. You will first see

the Confirm Perspective Switch dialog, as shown in

Figure 16. Click Yes to switch to the Debug

perspective. The UI for Debug perspective is shown in

Figure 17.

Figure 16

To start debug, Eclipse needs to switch to the Debug

perspective.

Figure 17

The debugger starts to run ShowCurrentTime.java.

7.3 Controlling Program Execution

The program pauses at the first line in the main method.

This line, called the current execution point, is

highlighted in green. The execution point marks the next

line of source code to be executed by the debugger.

When the program pauses at the execution point, you can

issue debugging commands to control the execution of the program. You also can inspect or modify the values of

variables in the program.

When Eclipse is in the debugging mode, the toolbar buttons for debugging are displayed in the Debug window, as shown in Figure 17. The toolbar button commands also appear in the Run menu (see Figure 18). Here are the commands for

controlling program execution:

?Resume resumes the execution of a paused program.

?Suspend temporarily stops execution of a program.

?Terminate ends the current debugging session.

?Step Into executes a single statement or steps into a method.

?Step Over executes a single statement. If the statement contains a call to a method, the entire method is

executed without stepping through it.

?Step Return executes all the statements in the current method and returns to its caller.

?Run to Line runs the program, starting from the current execution point, and pauses and places the execution

point on the line of code containing the cursor, or at

a breakpoint.

Figure 18

The debugging commands appear under the Debug menu.

7.4 Examining and Modifying Variables

Among the most powerful features of an integrated debugger

is its capability to examine the values of variables, array items, and objects, or the values of the parameters passed

in a method call. You also can modify a variable value if you want to try a new value to continue debugging without restarting the program.

To demonstrate it, choose Run, Step Over to execute one line in the source code, and you will see the value for totalMilliseconds in the Variables pane, as shown in Figure 19.

Figure 19

The value for variable totalMilliseconds is displayed

in the Variable pane.

To change the value in totalMilliseconds, double-click on totalMilliseconds to display the Set Value dialog box, as shown in Figure 20. You can now set a new value for totalMilliseconds.

Figure 20

The Set Value dialog box enables you to change the

value for a variable.

TIP:

The debugger is an indispensable, powerful tool

that boosts your programming productivity. It

may take you some time to become familiar with

it, but the effort will pay off in the long run.

Note:

The debugger is not only a valuable tool for

finding errors, but it is also a valuable

pedagogical tool for learning programming.

Note:

After finishing debugging, you may switch to the

Java perspective by choosing Window, Open

Perspective, Java.

8 Creating and Testing Java Applets

You can create a Java applet in the same way you create a Java application. For example, you can create the WelcomeApplet class in Chapter 14, as shown in Figure 21.

Figure 21

Applets are created in the same way as applications. To run an applet, choose Run, Run As, Java Applet, as shown in Figure 22. Eclipse automatically creates an HTML file to contain the applet and invokes the appletviewer utility to run the applet, as shown in Figure 23.

Figure 22

Applets are created in the same way as applications.

Figure 23

The WelcomeApplet program runs from the applet viewer.

eclipse使用技巧

代码篇: 1.在源代码中快速跳转: eclipse中的跳转甚至比https://www.sodocs.net/doc/546667509.html,还方便,方法是按住Ctrl键,然后鼠标指向变量名,方法名,类名,就会出现链接,点击就可跳到定义处。 2.实时语法检查: 编辑区右侧如果有红色小方块,直接点击就可跳到有错的行;黄色小方块是警告,可以忽略,但最好检查一下;如果某个函数尚未完成,要提 醒自己注意怎么办?加上注释// TODO,右侧就会有蓝色小方块,提示你此处尚未完成。当一个源码的右侧没有任何提示时,说明这个文件已经 完成了。 3.自动生成getter/setter方法: 只需要申明protected,private类成员变量,然后在Package Explore中找到该类,右键点击,选择“Source”“Generate Getters and Setters”。 4.更改类名/变量名: 如果涉及到多处修改,不要直接在源码中更改,在Package Explore中找到要改名的类或变量,右键点击,选择“Refactor”“Rename”, eclipse会自动搜索所有相关代码并替换,确保不会遗漏或改错。 5.匹配Try: 如果写的代码需要抛出或者捕捉异常,在JBuilder中,你需要首先引入这个异常类,然后再在写好的代码前后加try,catch或者在方法后面加 throws,在eclipse里完全不必要这样,只需要写好代码,然后按ctrl + 1,这时会出来提示,提示你是throw还是catch这个异常,选择你需要 的,按下enter就可以了。 6.快速书写循环代码: 在写循环或者选择条件的语句时,先写出关键字如if、while,然后按alt + /自己去看有什么好处吧。接下来会出来提示代码,按下tab可以在 框框中跳,按下确定跳出代码提示。 热键篇: ctrl + D:删除行 ctrl + M:当前窗口的最大化或最小化 ctrl + L:跳到指定的行 ctrl + 1:代码纠错提示 alt + /:代码辅助提示 F11:运行上次运行的程序

Eclipse的debug操作手册

在本教程中,我们将看到使用Eclipse调试Java应用程序。调试可以帮助我们识别和解决应用程序中的缺陷。我们将重点放在运行时间的问题,而不是编译时错误。有提供像gdb的命令行调试器。在本教程中,我们将集中在基于GUI的调试,我们把我们最喜爱的IDE Eclipse来运行,通过本教程。虽然我们说的Eclipse,点大多是通用的,适用于调试使用的IDE像NetBeans。在看这篇文章前,我推荐你看一下Eclipse 快捷键手册,你也可以到这儿:下载PDF文件 我的eclipse版本是4.2 Juno。 0.三点特别提醒: ?不要使用System.out.println作为调试工具 ?启用所有组件的详细的日志记录级别 ?使用一个日志分析器来阅读日志 [ (System.out.println()对开发人员来说,有时候也许可以是一种调试手段,但是项目一旦完成他就没有什么用途了,就变成垃圾了,得必须注释或删除掉,这样会比较麻烦。启用所有组件的详细日志记录级别,运用日志分析器来记录详细系统运行状态,这对后期网站的优化和维护会有很多作用。)这仅仅是个人理解,仅供参考! ] 1.条件断点 想象一下我们平时如何添加断点,通常的做法是双击行号的左边。在debug视图中, BreakPoint View将所有断点都列出来,但是我们可以添加一个boolean类型的条件来决 定断点是否被跳过。如果条件为真,在断点处程序将停止,否则断点被跳过,程序继续执行。

2.异常断点 在断点view中有一个看起来像J!的按钮,我们可以使用它添加一个基于异常的断点,例如我们希望当NullPointerException抛出的时候程序暂停,我们可以这样: 3.观察点 这是一个很好的功能,他允许当一个选定的属性被访问或者被更改的时候程序执行暂停,并进行debug。最简单的办法是在类中声明成员变量的语句行号左边双击,就可以加入一个观察点。

Eclipse 3.4 安装及使用说明

Eclipse 3.4 安装及使用说明 1. 安装Eclipse 3.4 由于Eclipse是绿色软件,所以直接解压至任意目录即可(例如D:\eclipse)。 2.在Eclipse中安装tomcat插件 解压tomcatPluginV31.zip,获取com.sysdeo.eclipse.tomcat_3.1.0并直接复制到eclipse目录plugins文件夹下即可。如果插件安装成功,新建项目时(File->New->Project)会看到Tomcat Project,如图1所示,否则说明安装不成功。 图 1 接下来在Eclipse中配置Tomcat服务器。在eclipse的菜单中选择: Window->Preferences->Tomcat(没有安装Tomcat插件就不会出现这项),设置Tomcat

Version: 选择“Version 5.x”, Tomcat Home: “C:\Program Files\Apache S oftware Foundation\Tomcat 5.5\”,即Apache Tomcat的安装目录。 图 2 3.采用Eclipse开发简单的Web应用 3.1 创建新项目 新建Tomcat Project,项目名称为“testPrj”,如图3,单击Next按钮进入下一步,如图4,web服务应用根目录为“web”,单击Finish按钮完成项目创建。

图3

图 4 3.2 修改项目的配置及目录结构 单击如图5所示的下三角符号,打开弹出菜单,选择“Filters”,打开过滤器窗口,如图6所示,把“*.resources”项的勾选去掉以显示.classpath文件。打开该文件并进行修改:把“”修改为“”;把“”修改为“”,然后保存该文件。接下来删除“bin”文件夹,删除W EB-INF下的“s rc”文件夹,把“work”文件夹移至web目录下,在项目根目录下添加“s rc”和“test”文件夹,最后项目目录如图7所示。

eclipseCVS使用手册

Eclipse中CVS版本管理 版本管理 1.1 CVS简介 CVS是Concurrent Versions System(并发版本系统)的简称。它是一个开放源代码的项目,是当前最流行的版本控制系统,目前绝大部分Open Source项目都使用它来做版本管理。微软的VSS也可以用来进行Java项目的版本管理,但在学会使用Eclipse后,使用CVS。 CVS采用客户机/服务器体系,代码、文档的各种版本都存储在服务器端,开发者首先从服务器上获得一份复制到本机,然后在此基础上进行开发。开发者可随时将新代码提交给服务器,也可以通过更新操作获得最新的代码,保持与其他开发者的一致。 由于Eclipse本身内置了CVS客户端,只要再建立一个CVS服务器就可以使用这一功能强大的版本控制系统。CVS的功能虽强大,但一般项目通常只用到其20%的功能,所以只要了解最常用的操作就可以了。本系统是的是Eclipse 3.0.1版本,下面将以面向实际项目使用需要的方式来介绍CVS。 1.2 CVS服务器端的安装与配置 CVS起源于UNIX/Linux平台,由于我们平时大多使用的是Windows系统,所以在UNIX/Linux平台下安装使用CVS服务器端的方法,我们不再重复。CVS服务器在Windows 平台的版本:CVSNT,我们下面将着重介绍CVSNT的安装。 首先,我们得下载CVSNT,可以到CVSNT主页https://www.sodocs.net/doc/546667509.html,/downloads/去下载它,我们下载的是cvsnt 2.0.58d版本,把它安装在Windows XP系统上。 (1)运行安装程序,完全按照它的默认设置,连续单击“next”按钮,即可完成安装。我们把cvsnt安装在默认的“C:\Program Files\cvsnt”目录下。 (2)通过Windows选择“开始→所有程序→CVSNT”选项,打开cvsnt的设置面板“Service control panel”,如图1.1所示,表明上面两个服务已经启动。 注意 :如果提示找不到rundll32.exe,则单击“浏览”按钮,指向“C:\windows\system32\ 注意: rundll32.exe”并运行它。 (3)单击图1.1中的“Repositories”选项卡,再单击Add按钮,创建一个存放版本文件的目录“c:/cvsfile”,如图1.2所示,单击“OK”按钮后,在弹出的两个窗口中都回答“是”。 注意 注意: :建议在“Name”栏改写成绝对路径“c:/cvsfile”,就能够确保在cvsnt安装后可以 正常使用。

Eclipse使用方法[精髓]

附录C 3.2.2使用简介 C.3 使用开发工具进行编程 当下载并安装完毕Eclipse 3.2.2开发工具后,可以使用该开发工具进行代码的开发了,本节将使用该工具开发一段代码,介绍如何使用该开发工具进行编程,请按照如下步骤进行操作。 (1)首先打开Eclipse 3.2.2开发工具,稍等片刻之后,会进入到图C-8所示的界面,在这里将设置工程文件默认的存放路径。 图C-8 设置工程文件默认的存放路径 (2)本书选用默认路径作为工程文件的存放路径,当设置完成之后,就可以单击“OK”按钮,稍等片刻进入Eclipse 3.2.2的主程序。如图C-9所示。 图C-9 Eclipse 3.2.2主程序的欢迎界面 (3)这时可以将欢迎界面关掉,并单击“File” 菜单,将鼠标移动到“New”菜单项上,此时可以看

到图C-10所示的界面。 (4)在图C-11所示的“New”子菜单中选择“Project…”菜单项来创建工程文件,单击之后,会弹出一个图C-12所示的对话框。 (5)在该对话框中将选择所要创建工程的类型,可以选择“Java Project”选项,并单击“Next”按钮来进行创建。单击完“Next”按钮后,会进入图C-13所示的界面,在这里将设置工程文件的名称。 (3)可以在“Project Name”文本框中设置该工程的名称,例如这里将该工程的名称设置为“T est”,当设置完毕之后,可以单击“Fini sh”按钮完成设置。单击完“Fini sh”按钮后,可以在开发工具的主界面左侧看到本工程的工程树。如图C-14所示。 图C-12 选择工程文件的类型图C-13 设置工程文件的名称 图C-14 主界面中的工程树 (4)由于还没有创建文件,所以创建工程完毕之后,工程树比较空,这时可以为该工程创建代码文件,单击“File”菜单,并在其中“New”子菜单中选择“Class”选项。这样会弹出一个用来创建文件的向导提示框,如图C-15所示。

Eclipse完全手册

Eclipse 完全手册
Eclipse 是一个开放源码的、可扩展的应用开发平台,该平台为编程人员提供了一流的 Java 集成开发环境。作为一套开源工具,可用于构建 Web Services、J2EE 等各种类型的应用,其 所提供的功能不亚于、甚至要超过由专业的集成环境供应商所提供的商业化产品,如 JBuilder。
Eclipse 最有魅力的地方就在于它的插件体系结构。在这个体系中重要的概念是扩展点 (extension points),也就是为插件提供的接口。每一个插件都是在现有的扩展点上开发的, 并可能还留有自己的扩展点,以便在这个插件上继续开发。
由于有了插件,Eclipse 系统的核心部分在启动的时候要完成的工作十分简单:启动平台的 基础部分和查找系统的插件。在 Eclipse 中实现的绝大部分功能是由相应的插件完成的,比如 WrokBench UI 插件完成界面的外观显示,Resource Management 插件完成维护或生成项目或 文件等资源管理工作,而 Version and Configuration Management(VCM)插件则负责完成版 本控制功能,等等。虽然以上提到的每一个功能都是绝大多数 IDE 环境所必备的功能,Eclipse 却把它们都做成了插件模式,甚至用来开发 Java 程序的开发环境(Java development tooling, JDT),也只不过是 Eclipse 系统中的一个普通插件而已。整个 Eclipse 体系结构就像一个大拼 图,可以不断地向上加插件,同时,现有插件上还可以再加插件。
虽然大多数用户很乐于将 Eclipse 当做 Java IDE 来使用,但 Eclipse 的目标不仅限于此。 Eclipse 平台为工具提供者(Tools Provider)提供一套使用机制和一组需要遵循的规则,从而使 得开发出的工具之间可以实现无缝的集成。这些机制通过定义良好的 API 接口、类和方法提供 给用户使用,平台同样为新的工具的开发提供强有力的组件支持(如 Plug-in Development Environment,PDE——插件开发环境)。主要针对希望扩展 Eclipse 的软件开发人员,因为它 允许他们构建与 Eclipse 环境无缝集成的工具。由于 Eclipse 中的每样东西都是插件,对于给 Eclipse 提供插件,以及给用户提供一致和统一的集成开发环境而言,所有工具开发人员都具有 同等的发挥场所。
这种平等和一致性并不仅限于 Java 开发工具。尽管 Eclipse 是使用 Java 语言开发的,但 它的用途并不限于 Java 语言;例如,支持诸如 C/C++、COBOL 和 Eiffel 等编程语言的插件已 经可用, 或预计会推出。 Eclipse 框架还可用来作为与软件开发无关的其他应用程序类型的基础, 比如内容管理系统。

Eclipse使用指南

Eclipse使用指南(北京)技术有限公司

1 修订记录

2 目录 1修订记录 (1) 2目录 (1) 3概述 (1) 4基本操作 (1) 4.1常用的快捷键 (1) 4.2设置T ask (2) 4.3eclipse.ini配置 (2) 4.4代码模板 (2) 5插件 (3) 5.1Subversion插件 (3) 5.2Tomcat插件 (4) 6常见问题解答 (4) 6.1Javaw.exe启动有问题 (4) 6.2Ant不能执行 (4) 6.3ant超时解决办法 (4) 7参考资源 (5) 7.1插件地址 (5)

3 概述 本文是关于Eclipse的使用指南。内容包括:eclipse配置、快捷键的使用、使用建议、代码模版的配置、相关参考资源等。 4 基本操作 4.1 常用的快捷键 它可以大大的增强您的开发效率,要想成为高手的必备技能之一。 对于一个仅仅知道几个快捷键的选手,不要急于一天就能掌握所有的操作。可以每天重点使用几个,对于一个java程序员,几周就可以熟练掌握。 1. Alt+shift+s 操作source源代码的一些方式 2. F4 查看类的结构和继承关系 3.可以用Ctrl+shift+L可以查阅,它能增加巨大的效率。 4. Ctr+H:查找具体的类 5. F3 :等价于Ctr+被选中的某个单词 6.Ctrl+/:可以在选中一定的区域后,可以直接的全部加上注释。Ctrl + shift +/可以注释块。 7. Tab+shift:按钮可以跳tab距离。 8.全部选中+tab:可以向前跳置tab的距离。 9. F5和F6:是常用的调试按钮。非常的有用。 10.F4:在选中的类中可以查看类图的集成结构。 11.Shift+鼠标右键,可以选择一行,比直接的按住右键好用多了。 12.Ctr + Shift + o organize import 非常的好用。 13.Ctr + o Quick outline 14.Ctr + Shift + e 在单独的窗口中。列出当前所有的文件, 15.Ctr + T 查询调用该函数父函数。比F4好用。 16.Alt + shift + R 重命名选中的函数rename 17.Ctr + F3 可以查看类

Eclipse与ClearCase结合使用方法

eclipse与clearcase结合使用方法 ClearCase开发eclipse项目(二) 为User2 设置工作区域以访问由User1 所共享的模型 在本节章,User2 将通过创建一个web视图并在其工作空间中导入Piggy Bank UML 项目,来设置他个人的工作区域。要创建一个视图并导入此共享的Piggy Bank 建模项目,请遵循以下步骤: 1.启动User2 的客户端机器上的Software Architect。 2.当收到提示时,选择你的工作空间或者创建一个新的工作空间。 3.这会激活Software Architect 中的ClearCase Remote Client。为得到更多信息,参见 前面的在Software Architect 中激活ClearCase Remote Client 一节(由User1所执行)。 4.从Software Architect 中的ClearCase 透视图创建一个新的ClearCase Web 视图 (命名为baseccrc_view2)。为得到更多信息,参见在Software Architect 中创建一个ClearCase Web 视图,并加载Base ClearCase VOB 工件。 5.在Software Architect(ClearCase透视图)中的ClearCase Navigator 视图中,右键点 击baseccrc_view2 并选择Update Resource(如图21所示)以将UML Project 工件获取到你的本地Web 视图(baseccrc_view2)中。 图21:将UML Project 工件获取到你的本地Web 视图

Eclipse for C++使用说明

Eclipse(for C++)使用说明 1、启动eclipse,在命令行中输入eclipse,出现窗口,如下图所示: 2、添加工程 在file菜单中选择import,出现窗口如下: 3、在General下选择Existing Projects into Workspace,单击next,出现如下窗口:

4、点击Browse,选择工程位置,出现下图所示 5、单击Finish,工作区如下图所示:

6、修改build选项,有两种方法 方法一:在项目名称上单击右键,选择Properties 方法二:选中项目,在菜单栏,选择Project/Properties 出现下图: 在左边选择C/C++ Build,修改Build directory:选择File system,选择makefile所在的文件夹,点击OK 7、在菜单栏选择Project/Build All,整个项目开始编译,如下图所示:

8、Run,在菜单栏选择Run/Run Configurations,出现窗口如下: 选择Arguments,点击File System,然后选择可执行文件所在目录,点击Apply,Close 然后在工具栏点击,程序即可运行 9、Debug 在Project explorer中,选择可执行文件,然后在菜单栏选择Run/Debug As,出现如下对话框,或者在工具栏点击图标,配置如下图:

点击OK,会弹出如下窗口: 选择Yes,整个工作区将切换到debug模式,如下图所示:

10、切换工作区视图 11、其他 A、查看函数的定义,按下CTRL键后,将鼠标移动到函数名称上左键单击,即可跳转 到函数的定义处。 B、如果想返回到上一视图,在工具栏点击 C、将鼠标移动到函数定义处,然后按下F2键,即可在浮出的窗口中查看该函数的代码 D、在左边Project explore中双击文件,即可在工作区中打开该文件进行编辑 12、在Eclipse中使用CVS 在项目名上单击鼠标右键,在弹出的菜单中选择Team,会出现相关选项

Eclipse与CC集成操作手册

第一章综述 Eclipse开放工程是IBM集成开发工具,其强大完善的功能、开放的架构可以 适应各种级别的java开发。 Eclipse本身不集成有ClearCase ,需要添加插件才能集成。 第二章安装 Eclipse若要与CC集成,则需将ClearCase插件添加到Eclipse安装目录下的plugins文件里,如下所示: 配置结束后打开Eclipse,则在Eclipse的界面上显示ClearCase菜单项,如下图 所示:

第三章集成后的日常使用 3.1 创建工作区和共享文件夹 建立一个共享文件夹,用以存放视图信息(如:ccview_stg); 建立一个存放程序的文件夹(如:dzsbvob),该文件夹是用以存放从服务器上load下来的元素。 Eclipse的工作区(如:dzsb_work),该工作区用以存放Eclipse的相关信息;如下:

3.2 连接ClearCase Rational ClearCase 允许联机或脱机工作。如果决定访问 ClearCase 服务器,则必须与其连接。这里是必需的基本步骤。请注意,通常只需要连 接一次以启动任务的活动 要在Eclipse中连接到Rational ClearCase,请选择ClearCase→connect to Rational ClearCase菜单选项或单击ClearCase连接图标。当连接成功后,ClearCase里的菜单选项被激活。如下: 3.3 ClearCase创建视图 打开Project Explorer 控制台,如下:

在选择项目开发流(dzsb_dve_ks),右击→Create View,如下: 单击此菜单;

Eclipse操作指南

Eclipse操作指南和地质建模数据附录 第一部分Eclipse操作指南 一功能介绍 ECLIPSE100是一个全隐式,三维、三相,还包括天然气、凝析油选项功能综合的黑油模拟软件。 Eclipse的输入资料是用关键字系统自由格式输入的。任何标准的编辑程序都可以编辑输入文件。EDIT是一个可供选择的专门用于屏幕编辑的Eclipse编辑程序。当数据输入后,EDIT程序能检查输入数据。 Eclipse软件提供的角点模型和常规筷中心模型非常实用,在一、二和三维模拟中,径向和笛卡尔块中心点模型也都很有用。三维径向模型能模拟0~360o界面上的圆形流动(关键词COORDSYS)。 Eclipse角点模型是唯一的能对正确代表油藏最复杂的几何地质图形进行模拟。前处理程序FILL和GRID常用来准备eclipse油藏模拟的角点数据。独立图形的处理GRAF和GRID 程序能用多种方法显示网格。例如,在进行大型的三维模拟时,用户可要求同时显示在XZ 方向的多条横剖面。网格的平面透明覆盖图是十分有用的,它能正确地对地质平面图进行检查。 Eclipse软件有一套综合的单井控制选择程序。生产井能在给定的油量、水量、液量、气量、油藏流体废弃产量、井底压力和井口压力等数值下进行运算。油藏工程师应对上述数值中一项定出一个目标值,而对其余数值的各项定出限制值。生产井只要不超过限制,在规定的目标下工作。若一个限制值将要超越他的限制界限,那么生产井将自动改变它的控制模式,使井保持在允许的限制条件下工作。效率系数还可用于考虑正常的停产时间。该程序将能计算处于正常流动条件下的流量和流动压力,但累计流量按照有效系数进行扣除。这有助于历史拟合的全过程,生产井可处于另处一种控制类型。输入这些井实际生产的油、气和水量,使井处于相同的产液量的条件下生产,这样,甚至当含水率和气/油比不完全拟合时,压力下降的速度也是大致正确的。实际生产的和计算的这两个产量都可以编入汇总文件,以便进行图形对比。 二建模 1 建立实际模型(Flogrid建模) 煤层气产能数值模拟是跟实际的地质情况紧密联系的,在煤层气田地质和开发资料数据充足的情况下,需要建立包含各种地质参数的三维地质模型,在此基础上全面布井(虚拟井),进一步对所有井开展值模拟工作,从而达到气田产能预测的最终目的。

Eclipse使用指南96

Eclipse使用指南 张大为 全星科技珠海有限公司 2009-9-1 一、简介(此节内容为转载,只有小部分修改和添加) Eclipse最初是替代由IBM公司开发的价值4千万美金的商业软件Visual Age for Java的下一代IDE开发环境,2001年11月交给非营利软件供应商联盟Eclipse基金会(Eclipse Foundation)管理。2003年,Eclipse 3.0选择OSGi服务平台规范为运行时架构。 Eclipse 是一个开放源代码的、基于Java 的可扩展开发平台。就其本身而言,它只是一个框架和一组服务,用于通过插件组件构建开发环境。幸运的是,Eclipse 附带了一个标准的插件集,包括Java 开发工具(Java Development Tools,JDT)。虽然大多数用户很乐于将Eclipse 当作Java IDE 来使用,但Eclipse 的目标不仅限于此。Eclipse 还包括插件开发环境(Plug-in Development Environment,PDE),这个组件主要针对希望扩展Eclipse 的软件开发人员,因为它允许他们构建与Eclipse 环境无缝集成的工具。由于Eclipse 中的每样东西都是插件,对于给Eclipse 提供插件,以及给用户提供一致和统一的集成开发环境而言,所有工具开发人员都具有同等的发挥场所。 这种平等和一致性并不仅限于Java 开发工具。尽管Eclipse 是使用Java 语言开发的,但它的用途并不限于Java 语言;例如,支持诸如C/C++、COBOL、Eiffel、PHP、Ant等等编程语言的插件已经可用。Eclipse 框架还可用来作为与软件开发无关的其他应用程序类型的基础,比如内容管理系统,数据库系统。另外,很多Eclipse的爱好者开发了非常小巧且实用的插件,譬如Column(可以像UltraEdit那样按列编辑),Spell(检查拼写错误),Subclipse(SVN在Eclipse中的客户端插件)。 基于Eclipse 的应用程序的突出例子是IBM 的WebSphere Studio Workbench,它构成了IBM Java 开发工具系列的基础。例如,WebSphere Studio Application Developer 添加了对JSP、servlet、EJB、XML、Web 服务和数据库访问的支持。 注:本人最常用的插件为Column,Spell和Subclipse。

Eclipse使用方法介绍

(1)Eclipse启动后,弹出一个【工作空间启动程序】对话框,在【工作空间】文本框中输入“D:\java”目录,单击【确定】按钮。 工作空间workspace用于保存Eclipse所建立的程序项目和相关的设置。 (2)单击【确定】按钮,系统将出现Eclipse的欢迎界面,其中包含【概述】、【教程】、【样本】、【新增内容】以及工作台相关按钮和菜单栏等。

在Eclipse的欢迎界面中,单击【工作台】按钮或者关闭【欢迎】的界面窗口,将显示出Eclipse的工作台,包括标题栏、菜单栏、工具栏、编辑器、透视图和相关的视图。 3.Eclipse菜单栏 (1)文件菜单 包含【新建】、【保存】、【关闭】以及【刷新】等命令,主要用于新项目的创建、保存以及关闭等操作。 (2)编辑菜单 主要用于辅助程序设计代码设计工作、如代码的【复制】、【剪贴】和【粘贴】等。 (3)源代码菜单 包含的命令都是和代码编写相关的,主要用于复制编程工作。 (4)重构菜单 是Eclipse最为关键的菜单,主要包括对项目重构的相关命令,需重点掌握。 (5)项目菜单 用于管理Eclipse中的项目,用于项目的打开与关闭、自动构建等操作。 (6)运行菜单 包含了与程序运行和调试相关的各种操作,同时还具有保存运行和调试的记录功能。(7)窗口菜单 用于显示、隐藏或处理Eclipse中的各种视图和透视图。 4.Eclipse中创建Java项目 在Eclipse中编写应用程序时,需要先创建一个项目。Eclipse的多种项目中,其中Java 项目是用于管理和编写Java程序的。 (1)创建一个java项目

(2)新建一个类文件

安装Eclipse使用说明

Eclipse Tutorial For Introduction to Java Programming By Y. Daniel Liang This supplement covers the following topics: ?Getting Started with Eclipse ?Choosing a Perspective ?Creating a Project ?Creating a Java Program ?Compiling and Running a Java Program ?Run Java Applications from the Command Line ?Debugging in Eclipse NOTE: To use this supplement with the text, you may cover Sections 1 – 6 in this supplement after Chapter 1 in the text, cover Section 7 in this supplement after Chapter 2 in the text, and cover Section 8 in this supplement at the beginning of Chapter 15 in the text. 0 Introduction This tutorial is for students who are currently taking a Java course that uses Eclipse and for Java programmers who want to develop Java projects using Eclipse. Eclipse is an open source supported by IBM. You can use JDK command line utility to write Java programs. The JDK command line utility consists of a set of separate programs, such as compiler and interpreter, each of which is invoked from a command line. Besides the JDK command line utility, there are more than a dozen Java development tools on the market today, including Borland JBuilder, NetBeans, Sun ONE Studio (a commercial version of NetBeans), Eclipse, and WebGain Visual Café. These tools support an integrated development environment (IDE) for rapidly developing Java programs. Editing, compiling, building, debugging, and online help are integrated in one graphical user interface. Using these tools effectively will greatly increase your programming productivity. This brief tutorial will help you to become familiar with Eclipse. Specifically, you will learn how to create projects, create programs, compile, and run programs.

eclipse常用方法和快捷键说明

代码提示 菜单Window -> Perferences…-> General -> keys,在中间的列表中选中Command名称为Content Asssist的项,在下面的Binding中按下需要设置的快捷键,如下图的:Shift + Space,然后点Apply或OK保存设置。 快捷键设置完成后点击列表列表的Binding按快捷键名称排序,看看有没有和其他快捷键设重复。 代码提示的常用模板可以在该Perferences窗口的Java -> Editor -> Templates中找到,如Templates列表中第一项,Name为main的项,其下面的Preview中的内容为一个main方法的模板。

编辑页面会弹出提示面板,选择需要的提示项后回车确定。 此时Eclipse会自动为我们生成这个main方法的模板: 快速执行main、test等 如果我们写了一个测试用的main方法,需要马上执行,可以点工具栏中的执行Main方法 的按钮

也可以利用快捷键快速执行:Alt + Shirt + X,放开后键入J,默认会执行当前编辑java类中的main方法。 如果当前编辑的是一个JUnit测试类,则可以使用Alt + Shirt + X,放开后键入T,快速执行该JUnit类中的测试方法。 文件定位,展开、收起项目树 在树形结构的项目中快速定位当前编辑的文件:按下左侧面板中的按钮, 项目树将展开并高亮显示当前文件。要收起展开的树可以点击前面的按钮。 添加视图 不小心关闭了控制台或需要使用eclipse提供的其它视图,点菜单Window –> Show View,选择需要添加的视图。 文件在本地的历史版本 对于删除了且尚未上传到CVS或SVN的文件,右键点击文件所在的文件夹选中Restory from

eclipse操作说明书

一、新建工程 打开office File/new project;取名 example 单击Data,打开对话框 (一)单击 case definition,打开对话框Black oil(黑油模型);组分模型;热采;再这个界面上, 1、选择general: 输入模拟开始时间, 模型定义:网格数X*Y*Z;

单位(units):field,Metric,Lab 2、选择reservoir 定义Grid type:Cartesian;Radial 定义geometry type:Block centered;Corner point

选择流体类型:gas/oil/water 点击OK,返回data模块

(二)点击Grid,打开grid section如下对话框 从菜单项中打开,subsection/grid keyword, 打开grid keywords section

1、选择keywords type: Properties Insert keyword:PERMX;PERMY;PERMZ;NTG;PORO; 单击Apply

2、选择keywords type: Geometry Insert keyword:DX;DY;DZ;TOPS 3、选择keywords type: Operational keywords Insert keyword:NORCHO;SAVE;RPTGRID;INIT 4、可以选择水体等等。 5、单击close。Grid View中Run Simulation运算后观看 6、file/save file (四)打开PVT模块 从这个模块中输入流体参数,组分模型应该再PVT模块下进行组分模拟。

Cary Eclipse 中文使用说明书

Cary Eclipse 中文操作手册 美国瓦里安中国有限公司 分析仪器服务部

目录 一、开机及基本操作步骤 (3) 二、通用符号及工具条说明 (3) 三、应用软件 (9) (一).简单读数定波长测定软件 (9) (二.)浓度测定软件 (13) (三).波长扫描软件 (18) (四)动力学软件 (24) (五)高级读数定波长测定软件 (29) (六)系统信息软件 (33) (七)灯的调整…………………………………………..…35. (八)仪器检定标准软件 (38) 四、维护 (41) 五、Glossary术语表 (42)

1.一、开机及基本操作步骤 2.开电脑进入Windows系统。 3.开Cary Eclipse主机(注:保证样品室内是空的)。 4.双击Cary Eclipse图标。 5.在Cary Eclipse主显示窗下,双击所选图标(Concentration为例)。进入浓度主菜单 (详见后面浓度软件中文说明)。 6.新编一个方法步骤。 1).单击Setup功能键,进入参数设置页面。 2).按Cary Control→Options→Accessories→Standards→Samples→Reports→Auto store顺序,设置好每页的参数。然后按OK回到浓度主菜单。 3).单击View莱单,选择好需要显示的内容。 基本选顷Toolber;buttons;Graphics;Report。 4).单击Zero放空白到样品室内→按OK。 提示:Load blank press ok to read(放空白按ok读)。 5).单击Start.出现标准/样品选择页。 Solutions Available(溶液有效)。此左框中的标准或样品为不需要重新测量的内容。 Selected for Analysis(选择分析的标准和样品)。此右框的内容为准备分析的标准 和样品。 6).按ok进入分析测试。 Present std1(1.0g/l)提示:放标准1然后按OK键进行读数。 Press OK to read. 放标准2按OK进行读数。直到全部标准读完。 7).Present Sample1press OK to read. 放样品1按OK开始读样品,直到样品测完。 8).为了存标准曲线在方法中,可在测完标准后,不选择样品而由File文件菜单中存此编好的方法。以后调用此方法,标准曲线一起调出。 6.运行一个已存的方法(方法中包含标准曲线)。 1).单击File→单击Open Method→选调用方法名→单击Open. 2).单击Start开始运行调用的方法。 如用己存的标准曲线,在右框中将全部标准移到左框。按OK→进入样品测试。3).按提示完成全部样品的测试。 4).按Print键打印报告和标准曲线。 5).如要存数据和结果,单击File文件。 选Save Data As….在下面File name中送入数据文件名,单击Save。 全部操作完成。 其它软件包如Scan软件操作步骤相同,具体内容有些差别,请安屏幕提示操作。 二、通用符号及工具条说明 Graph(图形功能菜单):

maven2之m2eclipse使用手册

[使用心得]maven2之m2eclipse使用手册之一简介与配置文件settings.xml 近期因朋友项目中要用到maven2,所以顺带学习了一下,由于个人比较讨厌cmd的命令使用maven,所以没有去apache下在maven的安装文件使用,而eclipse正好提供了关于maven2的插件,结果发现不需要安装maven2的安装包即可拥有maven2的命令功能.本文章基于maven-2.2.1和m2eclipse0.10.0版本和eclipse-reporting-galileo-SR2版本(以包含eclipse-jee-galileo-SR2) 所写,如有跟其他版本有所出入请见谅 m2eclipse在线安装地址如下: https://www.sodocs.net/doc/546667509.html,/sites/m2e 安装前提必须Eclipse要求已经安装了以下插件: subclipse(svn) 在线安装地址:https://www.sodocs.net/doc/546667509.html,/update_1.6.x Mylyn在线安装地址:https://www.sodocs.net/doc/546667509.html,/tools/mylyn/update/e3.4/ Mylyn Extras (JIRA 支持): https://www.sodocs.net/doc/546667509.html,/tools/mylyn/ update/extras AspectJ Tools Platform (AJDT)在线安装地址:https://www.sodocs.net/doc/546667509.html,/tools/ajdt/35/dev/update Web Tools Platform (WTP)在线安装地址:https://www.sodocs.net/doc/546667509.html,/webtools/updates/ 由于本机没有独立安装maven2的安装包,所以安装完毕后是没有setting.xml这个配置文件的,启动eclipse后如果没有之前没有指定本地jdk路径的话,会提示要求指定jdk在那个地方,编辑eclipse.ini加入以下两段文字: -vm C:/Program Files/Java/jdk1.6.0_20/bin -vm:是指定当前虚拟机的位置,默认安装好的eclipse是没有该项的,记住-vm标记必须要在-vmargs前面加否则会出现报错, C:/Program Files/Java/jdk1.6.0_20/bin:就是你本机jdk bin的位置了 对于eclipse.ini的位置是在你所解压的eclipse中的根目录例如我的就是在E:\JavaWorkingTools\IDETools\Eclipse\IDE\eclipse\eclipse.ini 还有一个很重要的东西,m2eclipse已经为你创建了一个{user.dir}/.m2/repository的本地中央仓库的文件夹,你可以通过配置settings.xml来更改本地中央仓库的文件夹{user.dir}:就是你当前用户下的文件夹,例如我的是Edward 相对于maven2来说maven2的设置比maven1简单多了只有setting.xml和pom.xml。setting.xml用于配置对于仓库的设置和代理仓库等设置,而pom.xml则对当前项目的管理。 由于没有使用到maven2的安装包,装完m2eclipse是没有settings.xml的文件的,需要自己手动新建一个settings.xml文件. 对于settings.xml文件 settings.xml基本结构如下:

相关主题