| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML> |
| <HEAD> |
| |
| <meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2005. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." > |
| |
| <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> |
| <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> |
| |
| <LINK REL="STYLESHEET" HREF="book.css" CHARSET="ISO-8859-1" TYPE="text/css"> |
| <title> Quick Start Guide</title> |
| |
| </HEAD> |
| <BODY BGCOLOR="#ffffff"> |
| <H1 CLASS="Head"> Quick Start Guide</H1> |
| <P>This tutorial introduces you to the Workbench, providing a brief overview of |
| the steps required to create simple applications. More extensive explanations, |
| including images, are available in the Workbench User Guide.</P> |
| <P><strong>Workbench Quick Start</strong></P> |
| <table width="75%" border="1"> |
| <tr> |
| <td width="32%"><strong>Task</strong></td> |
| <td width="68%"><strong>Description</strong></td> |
| </tr> |
| <tr> |
| <td><p>Create a Simple Project</p> |
| <p> </p> |
| <p> </p></td> |
| <td><ol> |
| <li>Select <strong>File > New > Project...</strong>.</li> |
| <li>In the New Project wizard, select <strong>Simple > Project </strong>then |
| click <strong>Next</strong>. </li> |
| <li>In the <strong>Project name </strong>field type a name for your new |
| project.</li> |
| <li> |
| <p>Specify a location for the project or use the default. </p> |
| </li> |
| <li> |
| <p>Click <strong>Finish</strong>.</p> |
| </li> |
| </ol></td> |
| </tr> |
| <tr> |
| <td><p>Create a Folder</p> |
| <p> </p> |
| <p> </p></td> |
| <td> <ol> |
| <li>Ensure one or more projects exist.</li> |
| <li>Select <strong>File > New > Folder</strong>.</li> |
| <li>In the <strong>Folder name </strong>field of the New Folder wizard, |
| type a name for your new folder.</li> |
| <li>Click <strong>Finish</strong>.</li> |
| </ol></td> |
| </tr> |
| <tr> |
| <td><p>Create a File</p> |
| <p> </p></td> |
| <td><ol> |
| <li>Ensure one or more projects exist.</li> |
| <li>Select <strong>File > New > File</strong>.</li> |
| <li>In the <strong>File name </strong>field of the New Folder wizard, |
| type a name for your new folder.</li> |
| <li>Click <strong>Finish</strong>.</li> |
| </ol></td> |
| </tr> |
| <tr> |
| <td><p>Import Resources</p> |
| <p> </p> |
| <p> </p></td> |
| <td><ol> |
| <li>Select <strong>File > Import</strong>.</li> |
| <li>Select an import source.</li> |
| <li>Click <strong>Next</strong>.</li> |
| <li>Select the import location containing the resource by following the |
| steps indicated in the applicable wizard.</li> |
| <li>Click <strong>Finish</strong>.</li> |
| </ol></td> |
| </tr> |
| <tr> |
| <td><p>Export Resources</p> |
| <p> </p> |
| <p> </p></td> |
| <td><ol> |
| <li>Select <strong>File > Export</strong>.</li> |
| <li>Select an export destination.</li> |
| <li>Click <strong>Next</strong>.</li> |
| <li> Select the export destination by following the steps indicated in |
| the applicable wizard.</li> |
| <li>Click <strong>Finish</strong>.</li> |
| </ol></td> |
| </tr> |
| <tr> |
| <td>Create a Java Project: JUnit example</td> |
| <td><ol> |
| <li>To download the JUnit source code, visit http://www.eclipse.org/downloads/ |
| and locate the Eclipse release that you are working with. </li> |
| <li>Scroll down to the Example Plug-ins section and download the examples |
| archive. </li> |
| <li> Extract the contents of the Zip file to a directory. </li> |
| <li>Return to Eclipse and select <strong>File > New > Project...</strong>.</li> |
| <li> Select <strong>Java Project </strong>then click <strong>Next</strong>. |
| </li> |
| <li>In the <strong>Project name</strong> field type <strong>JUnit</strong>.</li> |
| <li>Click <strong>Finish</strong>.</li> |
| <li>In the Package Explorer, make sure that the JUnit project is selected. |
| </li> |
| <li>Select the menu item <strong>File > Import...</strong>. </li> |
| <li>Select Zip file, then click <strong>Next</strong>.</li> |
| <li> Click <strong>Browse </strong>next to the Zip file field and browse |
| to select <ExamplesDownloadPath>eclipse/plugins/org.eclipse.jdt.ui.examples.projects_3.0.0/archive/junit/junit381src.jar.</li> |
| <li> |
| <p>In the Import wizard, below the hierarchy list click <strong>Select |
| All</strong>. </p> |
| </li> |
| <li> |
| <p>Once the JUnit project appears in the destination <strong>Folder |
| </strong>field click <strong>Finish</strong>. </p> |
| </li> |
| <li> |
| <p>In the import progress indicator, notice that the imported resources |
| are compiled as they are imported into the workbench. This is because |
| the <strong>Build automatically </strong>option is checked on the |
| Workbench preferences page. You will be prompted to overwrite the |
| .classpath and .project files in the JUnit project. This is because |
| the .classpath resource was created for you when you created the JUnit |
| project. It is safe to overwrite these files. <br> |
| In the Package Explorer view, expand the JUnit project to view the |
| JUnit packages. </p> |
| </li> |
| </ol></td> |
| </tr> |
| <tr> |
| <td>Create a Java Class: JUnit Example</td> |
| <td> <ol> |
| <li> In the Package Explorer view, right-click the JUnit project, select |
| <strong>New > Package</strong>.</li> |
| <li> In the <strong>Name</strong> field, type <strong>test</strong> as |
| the name for the new package. </li> |
| <li>Click<strong> Finish</strong>. </li> |
| <li>In the Package Explorer view, select the new test package and click |
| <strong>New Java Class </strong>in the toolbar. Make sure that <strong>JUnit</strong> |
| appears in the Source Folder field and that <strong>test</strong> appears |
| in the Package field.</li> |
| <li> In the Name field, type <strong>MyTestCase</strong>.</li> |
| <li>Next to the <strong>Superclass </strong>field, click <strong>Browse</strong>. |
| </li> |
| <li>In the <strong>Choose a type </strong>field in the Superclass Selection |
| dialog, type <strong>Test </strong>to narrow the list of available superclasses. |
| </li> |
| <li>Select the <strong>TestCase</strong> class and click <strong>OK</strong>. |
| </li> |
| <li>Select the checkbox for <strong>Constructors from superclass</strong>. |
| </li> |
| <li> Click <strong>Finish</strong>.</li> |
| <li>The new file is opened in the editor. In the Outline view select the |
| new class <strong>MyTestCase</strong>. Open the context menu and select |
| <strong>Source > Override/Implement Methods...</strong>.</li> |
| <li>In the Override Methods dialog, check <strong>setUp()</strong> and |
| <strong>tearDown()</strong> and click <strong>OK.</strong> </li> |
| <li>Change the body of <strong>setUp()</strong> to container= new Vector();.</li> |
| <li><strong> container </strong>and <strong>Vector </strong>are underlined |
| with a problem highlight line as they cannot be resolved. A light bulb |
| appears on the marker bar. Set the cursor inside Vector and press Ctrl+1 |
| (or use <strong>Edit > Quick Fix from the menu bar</strong>). Choose |
| <strong>Import 'Vector' (java.util)</strong>.This adds the missing import |
| declaration. </li> |
| <li>Set the cursor inside <strong>container </strong>and press Ctrl+1. |
| Choose <strong>Create field 'container' </strong>to add the new field. |
| </li> |
| <li>In the Outline view, select the class <strong>MyTestCase</strong>. |
| Open the context menu and select <strong>Source > Generate Getter |
| and Setter...</strong>.</li> |
| <li> The Generate Getter and Setter dialog suggests that you create the |
| methods getContainer and setContainer. Select both and click <strong>OK</strong>. |
| A getter and setter method for the field container are added.</li> |
| <li>Save the file.</li> |
| <li> The formatting of generated code can be configured in <strong>Window |
| > Preferences > Java > Code Style > Code Formatter</strong>. |
| If you use a prefix or suffix for field names, you can specify this |
| in <strong>Window > Preferences > Java > Code Style > Fields</strong> |
| so that generated getters and setters will suggest method names without |
| the prefix or suffix. </li> |
| </ol></td> |
| </tr> |
| <tr> |
| <td> |
| <p> </p> |
| <p>Launch a Java Program: JUnit Example</p></td> |
| <td> |
| <ol> |
| <li>In the Package Explorer view, <strong>find junit.textui.TestRunner.java</strong> |
| and double-click it to open it in an editor. </li> |
| <li><em>In the Outline view, notice that the TestRunner class has an icon |
| which indicates that the class defines a main method.</em></li> |
| <li>Right-click <strong>TestRunner.java </strong>in the Package Explorer |
| and select <strong>Run > Java Application</strong>.</li> |
| <li>Select <strong>Run > Run...</strong>. The Launch Configurations |
| dialog opens with the TestRunner launch configuration selected. </li> |
| <li> In the Launch Configurations dialog select the <strong>Arguments |
| </strong>tab and type <strong>junit.samples.VectorTest</strong> in the |
| Program arguments area. </li> |
| <li>Click <strong>Run</strong>. This time the program runs correctly, |
| indicating the number of tests that were run. </li> |
| <li>Switch to the Debug perspective. In the Debug view, notice that a |
| process for the last program launch was registered when the program |
| was run.</li> |
| <li>Click <strong>Run </strong>in the workbench toolbar. This list contains |
| the previously launched programs. These programs can be relaunched by |
| selecting them in the history list. </li> |
| <li>From the context menu in the Debug view (or the equivalent toolbar |
| button), select <strong>Remove All Terminated</strong> to clear the |
| view of terminated launch processes. </li> |
| </ol></td> |
| </tr> |
| <tr> |
| <td> |
| <p>Create a </p> |
| <p>Plug-in</p></td> |
| <td> |
| <ol> |
| <li>Select <strong>File > New > Project</strong>.</li> |
| <li>Select <strong>Plug-in Project</strong> and click <strong>Next</strong>.</li> |
| <li>In the <strong>Project name</strong> field, type a name for your project |
| and click <strong>Next</strong>.</li> |
| <li>In the <strong>Plug-in Content </strong>page, set the data with which |
| the plugin.xml file will be initialized, including the plug-in ID, version |
| and name.</li> |
| <li>Select an available template and click <strong>Next</strong>.</li> |
| <li>Customize the sample extension and click <strong>Finish</strong>. |
| </li> |
| </ol> |
| </td> |
| </tr> |
| <tr> |
| <td>Launch an Eclipse runtime workbench instance to test a plug-in</td> |
| <td> |
| <ol> |
| <li>Select <strong>Run > Run...</strong>. </li> |
| <li>In the Launch Configuration dialog, type a name for your configuration |
| in the <strong>Name</strong> field.</li> |
| <li>In the <strong>Workspace data </strong>field, click <strong>Browse</strong> |
| to define the workspace that will be used by the run-time workbench. |
| The location of this runtime workspace must be different from the workspace |
| of your host instance.</li> |
| <li>In the <strong>Run an application</strong> field select the default |
| Eclipse application <strong>org.eclipse.ui.ide.workbench</strong>.</li> |
| <li>Click <strong>Run.</strong></li> |
| </ol> |
| <p>A second workbench instance will appear whose constituent plug-ins are |
| the workspace plug-ins and the plug-ins selected on the Target Platform |
| preference page. You can test your runtime workbench using the JRE of |
| your choice and does not have to be the same one against which your plug-ins |
| compile in the workspace. You can also specify any VM arguments that are |
| appropriate for your testing. </p> |
| </td> |
| </tr> |
| <tr> |
| <td>Automatically performing builds </td> |
| <td> <ol> |
| <li>Select <strong>Window > Preferences</strong>.</li> |
| <li>Select the <strong>General </strong>category in the left pane.</li> |
| <li> Select <strong>Build automatically</strong>. </li> |
| <li>Click <strong>OK</strong>. </li> |
| </ol></td> |
| </tr> |
| <tr> |
| <td>Manually performing builds </td> |
| <td><ol> |
| <li>In the Navigator view of the Resource perspective, select one or more |
| projects. </li> |
| <li>Right-click and select the option <strong>Build Project </strong>from |
| the pop-up menu. </li> |
| </ol></td> |
| </tr> |
| </table> |
| <P><strong>CVS Quick Start</strong></P> |
| <P><strong>Note:</strong> A CVS server must already be configured on the host |
| machine to create a valid repository location in the Workbench.</P> |
| <table width="75%" border="1"> |
| <tr> |
| <td width="32%"><strong>Task</strong></td> |
| <td width="68%"><strong>Description</strong></td> |
| </tr> |
| <tr> |
| <td> <p>Creating a CVS repository location</p> |
| <p> </p></td> |
| <td><ol> |
| <li>Select <strong>Window > Show View > Other... </strong> </li> |
| <li>Select <strong>CVS > CVS</strong> <strong>Repositories</strong>.</li> |
| <li>Click <strong>Add CVS Repository</strong>.</li> |
| <li>Enter the information required to identify and connect to the repository |
| location.</li> |
| <li>Click <strong>Finish</strong>. </li> |
| </ol></td> |
| </tr> |
| <tr> |
| <td>Connecting and configuring CVS with SSH</td> |
| <td><ol> |
| <li>Select <strong>Window > Preferences</strong>.</li> |
| <li>Select <strong>Team > CVS > SSH2 Connection Method</strong>.</li> |
| <li>Select the <strong>General </strong>tab, click <strong>Add Private |
| Key</strong> and add your private key to the list.</li> |
| <li>Provide a password for your private key and save it on your computer.</li> |
| </ol> |
| <p>If you do not have a key pair:</p> |
| <p></p> |
| <ol> |
| <li>Select <strong>Window > Preferences</strong>.</li> |
| <li>Select <strong>Team > CVS > SSH2 Connection Method</strong>.</li> |
| <li>Select the <strong>Key Management</strong> tab.</li> |
| <li>If your server supports version 1 of the protocol, select <strong>Generate |
| RSA key</strong>, for version 2 select <strong>Generate DSA key</strong>. |
| A public key and private key will be generated. The public key will |
| be shown in the read-only text area. </li> |
| <li>Copy the public key to your server. If your server is running an OpenSSH |
| server, click <strong>Export via sftp</strong>. Otherwise copy and paste |
| the public key into your remote ~/.ssh/authorized_keys file.</li> |
| </ol></td> |
| </tr> |
| <tr> |
| <td>Checking out a project from a CVS repository</td> |
| <td> <ol> |
| <li>Switch to the CVS Repository Exploring perspective. </li> |
| <li> In the CVS Repositories view, expand the repository location.</li> |
| <li>Expand HEAD and select the folders that you want to add as projects |
| to the Workbench. </li> |
| <li>Select one of the following from the menu for the selected folders: |
| <ul> |
| <li><strong>Check Out</strong> to check out each of the selected folders |
| as a project in the local workspace with the same name as the folder |
| in the repository.</li> |
| <li><strong> Check Out As... </strong>to check out the selected folders |
| into a custom configured project in the local workspace. </li> |
| </ul> |
| </li> |
| </ol></td> |
| </tr> |
| <tr> |
| <td>Synchronizing with the Repository and Updating or Committing changes</td> |
| <td><ol> |
| <li>In the Navigator view, select the resources that you want to synchronize.</li> |
| <li> Right click and select <strong>Team > Synchronize with Repository</strong>. |
| </li> |
| <li>In the Synchronize view, right-click the resource and select one of |
| the following: |
| <ul> |
| <li><strong>Commit</strong>, if you want to override the existing |
| CVS version of the resource and save your version to the repository.</li> |
| <li><strong>Update</strong>, if you want to update your workspace |
| with the version stored within the repository. |
| </li> |
| </ul> |
| </li> |
| </ol></td> |
| </tr> |
| </table> |
| |
| |
| </BODY> |
| </HTML> |