At present, various integrated development environments (IDEs) in the Java development field present, from Borland's JBuilder, to IBM Visual? Age? For? Java, WebSphere? Studio, Oracle's JDeveloper, Sun's WORTE? FOR? Java, WebGain's Visual? Cafe, TOGETHERSOFT TOGETHER, as well as an open source Eclipse, NetBeans?, Etc., 10 kinds of kinds. Such a variety of IDEs have prospered Java development tools, but also puts a problem for the selection of developers. The development environment of these IDEs has a large difference, and the projects developed in a development environment cannot be easily ported to another development environment, which requires more careful development tools for project objectives. In all IdEs, Eclipse can be said to be one of the most developed products. Eclipse was originally created by the IDE product development group of OTI and IBM, starting from April 1999. IBM provides the initial Eclipse code foundation, including Platform, JDT, and PDE. It is currently led by IBM, which has developed around the Eclipse project, has become a huge Eclipse alliance, and more than 150 software companies are involved in the Eclipse project, including Borland, Rational? Software, Red? Hat and Sybase, recent Oracle also plans to join In the Eclipse alliance. Basic concepts are necessary to explain some nouns on this project before learning to use Eclipse. • Eclipse is an open source software development project that provides a full-featured, commercially available industrial platform for highly integrated tool development. It consists of three projects of Eclipse project, Eclipse tool project, and Eclipse technology projects, and each project is supervised by a project management committee and manages it by its project. Each project consists of its own subproject, and uses the "common? Public? License (CPL) version 1.0 license agreement. • Eclipse Tools project provides a focus for different tool builders to ensure that the best tools are created for Eclipse? Platform. The Task of the Eclipse tool project is to create a wide range of tools for Eclipse? Platform. Tool projects provide a single contact point to make an open source tool constructor, making override and repetition, minimizing sharing, and the creation of shared components, promoting seamless interoperability of different types of tools. Tools Projects are proposed by the Tool Developer Commission and Tools Projects, subtitles, chosen and developed sub-projects. • The task of Eclipse Technical Projects provides new pipelines for open source developers, researchers, colleges and educators to participate in the evolution of Eclipse in the future. It organizes three projects in research, cultivation and education, and research projects explore and study in Eclipse related areas such as programming languages, tools and development environment; cultivating projects are small, unsuccessful structured projects, for Eclipse software Foundation add new ability; education project focuses on the development, teaching help and courseware of education materials. • Eclipse? Platform is an open scalable IDE. Eclipse? Platform provides a basis for building blocks and construction and running integrated software development tools. Eclipse? Platform allows tool builders to develop a seamless integration with others. You don't have to distinguish a tool feature where it ends, and another tool feature starts. • Eclipse? SDK (Software Developer Package) is the components of the three Eclipse projects (Platform, JDT, PDE), which can be downloaded once.
These parts provide a development environment with rich features that allow developers to effectively build tools that can be seamlessly integrated into Eclipse? Platage. Eclipse? SDK is combined by the tool produced by Eclipse project and third-party software from other open source code. The software produced by the Eclipse project is published in the CPL, and the third party components have their own license agreements. ? Download, install Eclipse knows these information about the Eclipse project, we can download, install an Eclipse. Eclipse? SDK is what we want to download, including all content of all content and Eclipse projects developed by developing Java applications. • Enter the homepage of the Eclipse project http://www.eclipse.org, click on Downloads to enter the download page. The latest version of Eclipse is version 2.0.2, but the multi-language translation package of version 2.0.2 has not yet come out, so we can use a little bit of version 2.0.1. Click 2.0.1 to enter its download page, this page has a lot of download connections, including Eclipse? SDK in many platforms, here we only need to download Eclipse-sdk-2.0.1-Win32.zip and NLS-SDK-2.0. 1-Translations.zip is OK, there is another? Eclipse-examples-2.0.1-win32.zip file is required to learn the Java Development User Guide. Unzip these three files to the same directory, such as D: / Eclipse. • First before running Eclipse, you should install the JDK (Sun? JDK or IBM JDK can be installed, you should install 1.4 or more version, recommended to use the above version, because only JDK using 1.4 or later can enjoy new HotSwap Features for debugging), set up environment variables Java_Home, ClassPath, and Path. • Eclipse.exe under D: / Eclipse creates a shortcut on the desktop. Double click to start Eclipse. Eclipse can also start in a command line, specify the JVM and save data on the command line, for example:? D: /eclipse/eclipse.exe-vmd: / WebSphere / Appserver / java /bin/javaw.exe? -Data? D: / Work / WorkSpace? where D: / Work / Workspace is the location of the save project file. • You can choose Help → Help content to enter the Help system of Eclipse. With Eclipse's multi-language translation pack, all menu and online help have been translated into Chinese, which is very convenient to use. Before making the following learning, it is recommended to browse the "Workbed User Guide" in the help, familiar with the concept of perspective and view.
Write a Hello? World program, let's write a HellWorld program, steps below:? 1. Select File → New → Project;? 2. Project categories selection java ;? 3. The project list selection Java project;? 4. Click "Next";? 5. Enter the project name, for example: helloproject ;? 6. Click "Finish";? 7. In the tool bar, click "Create Java Class" button (with a C mark) see Figure 1 ;? [img: fbd2928e14] http://developer.ccidnet.com/pub/attachment/2003/2/87667.gif [/ IMG: FBD2928E14] Figure 1? Click "Create Java Class" to call Figure 8. Enter helloworld ;? 9 in the name domain. Click on public? Static? Void? Main (String [] args) check box, let Eclipse create main method (see Figure 2) ;? [img: fbd2928e14] http://developer.ccidnet.com/pub/ Attachment / 2003/2 / 87670.gif [/ IMG: FBD2928E14] Figure 2? Eclipse creates main method 10. Click "Finish";? 11. A Java editing window will open, enter System.out.Println ("Hello? World") line in the main method;? 12. Use Ctrl-S to save it automatically? HelloWorld.java ;? 13. Click the "Run" button in the toolbar;? 14. Select "Java Application" and select "New";? 15. Enter the project name Hello-Project and Main class name? HelloWorld;? 16. Click "Run";? 17. At this time, a console window will be opened, a sentence? "Hello? World" will be displayed inside (see Figure 3). ? [img: fbd2928e14] http://developer.ccidnet.com/pub/attachment/2003/2/87672.gif [/ img: fbd2928e14] Figure 3? "Hello WORLD" display window Eclipse has an incremental compiler When a Java file is saved each time it automatically compiles. This feature is called "automatic build". If this feature is not required, you can perform automatic build on the window → preference → Workbench → to perform automatic build, turn off this feature. The "All Build" button will appear in the toolbar. Similar options will also appear in the relevant menu. • Creating a CVS Resource Library Now we know how to create a project, the next step is to establish a connection with a version server to publish the project to the version server. At present, open source software uses CVS to make version management, so we also use CVS to exemplify. Eclipse? SDK already includes a plug-in that supports CVS, you want to use other version management software, such as VSS, can download related plugins from the Eclipse website. The steps to create a CVS repository location are as follows:? 1. Open CVS Resource Library Development Perspective (Window → Open Perspective → Other → CVS Resource Library Development). ? 2. Right-click on the CVS repository view, create a new → repository location, see Figure 4.
? [img: fbd2928e14] http://developer.ccidnet.com/pub/attachment/2003/2/87674.gif [/ img: fbd2928e14] Figure 4? New Resource Location 3. Enter the details of CVS? Server? In the Add CVS Repayment dialog. ? 4. Click "Finish". ? 5. Once the CVS repository is configured, you can enter the project to enter the repository. Go to the Java perspective, right click on the project name, select the group → sharing item. ? 6. Select the repository that just added. ? 7. Click "Finish". ? 8. Right-click on the project in the synchronization window, choose the submission. ? 9. Enter a comment to submit to join, as shown in Figure 5. ? [img: fbd2928e14] http://developer.ccidnet.com/pub/attachment/2003/2/87676.gif [/ img: fbd2928e14] Figure 5? To submit an annotation 10. Click "OK", the project is released to the CVS repository.
11. After sharing projects in the resource library, you can use the "Synchronization" feature to "Synchronize" and caught up with someone else's modifications to the code in the resource library. Right-click on the project, group → synchronize with the repository. Download, install the application server JBoss In order to do server-side development, you need an application server and integrate the application server with Eclipse. Eclipse can work together with a variety of application servers, including WebLogic, WebSphere, Jrun, Orion / Oracle9ias, JBoss, Jonas, Resin, etc. The following is exemplified by the current popular open source application server JBoss. First you have to download and install JBoss, I am using JBoss? 3.0.3, installed in the D: /JBoss-3.0.3 directory. In order to integrate JBoss with Eclipse, you also need to download related plugins, download location is http://www.genuitec.com/products_easie.htm, http://www.genuitec.com/products/easiejboss1.0.6.zip. There is also a installation guide in http://www.genuitec.com/products/eclipse_jboss.pdf. Exit Eclipse, unzip the file just downloaded under D: / Eclipse, restart Eclipse. • The newly installed plugin needs to be activated to use, select the window → custom perspective, select the Easie® JBoss item in "Other". Then configure this plugin, select Window → Preferences, and enter information about the JBOSS plugin. • After the above two steps are performed, a button that starts and stops JBoss will appear in the toolbar. Click the Start button to start JBoss, as shown in Figure 6. ? [IMG: 12E90C0688] http://developer.ccidnet.com/pub/attachment/2003/2/87698.gif [/ img: 12e90c0688] Figure 6? Start JBoss open debugging view, will be in the debug perspective See the information related to the JBoss process just started. • Stop JBoss can use the stop button next to the start button. In this site, there is a plugin that supports WebLogic, WebSphere, orion / Oracle? 9ias, and the installation method is basically exactly the same. • Eclipse debugging until now, build a complete development environment is basically completed. Let's go back to the Hello WORLD project, look at what is needed to do in the debugger. • People with IDE are very familiar with the concept of breakpoints, single-step operation, and Eclipse has debugging features that all IDEs should have. The debugging step is as follows:? 1. First, set a breakpoint in the program, double-click the gray area on the left of the statement, then a breakpoint is added to the statement, as shown in Figure 7 ;? [img: 12e90c0688] http://developer.ccidnet.com/pub/attachment / 2003/2/87702.gif[/img:12e90c0688] Figure 7? Set breakpoint 2. Click the debug button in the toolbar (a bug) ;? 3. Select HelloWorld ;? 4 under the Java application. Click "Debug", the program will run to the breakpoints just set, and then stop running;? 5. Press F6, step on step, and then the program runs to the next statement;? 6. Press F8 to continue to run to the end of the program. • Importing the JUnit Example The following we import a real project, this project comes from an example of Eclipse? JDT.