carbidecpp22devenv/configuration/org.eclipse.osgi/bundles/121/1/.cp/cheatsheets/HelloWorld.xml
author cawthron
Fri, 04 Dec 2009 10:01:33 -0600
changeset 5 684bf18fdedf
permissions -rw-r--r--
add files for RCL_2_2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     1
<?xml version="1.0" encoding="UTF-8"?>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     2
<cheatsheet title="Create a Hello World application">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     3
   <intro href="/org.eclipse.platform.doc.user/reference/ref-cheatsheets.htm">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     4
      <description>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     5
         This cheat sheet shows you how to create the famous &quot;Hello World&quot; application and try it out. You will create a Java project and a Java class that will print &quot;Hello world!&quot; in the console when run.<br/>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     6
<br/>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     7
If you need help at any step, click the (?) to the right. Let&apos;s get started!
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     8
      </description>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     9
   </intro>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    10
   <item title="Open the Java perspective" dialog="false" skip="false" href="/org.eclipse.platform.doc.user/concepts/concepts-4.htm">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    11
      <description>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    12
         If you&apos;re not already in the Java perspective, in the main menu select <b>Window</b> &gt; <b>Open Perspective</b> &gt; <b>Java</b> or click on the &quot;Click to Perform&quot; link below.
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    13
      </description>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    14
      <command serialization="org.eclipse.ui.perspectives.showPerspective(org.eclipse.ui.perspectives.showPerspective.perspectiveId=org.eclipse.jdt.ui.JavaPerspective)" required="false" translate="">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    15
      </command>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    16
   </item>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    17
   <item title="Create a Java project" dialog="true" skip="false" href="/org.eclipse.jdt.doc.user/concepts/concept-java-project.htm">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    18
      <description>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    19
         Before creating a class, we need a project to put it in. In the main toolbar, click on the <b>New Java Project</b> button, or click on the link below. Enter <b>HelloWorld</b> for the project name, then	click <b>Finish</b>.
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    20
      </description>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    21
      <command serialization="org.eclipse.ui.newWizard(newWizardId=org.eclipse.jdt.ui.wizards.JavaProjectWizard)" required="false" translate="">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    22
      </command>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    23
   </item>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    24
   <item title="Create your HelloWorld class" dialog="true" skip="false" href="/org.eclipse.jdt.doc.user/gettingStarted/qs-9.htm">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    25
      <description>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    26
         The next step is to create a new class. In the main toolbar again, click on the <b>New Java Class</b> button (or the link below). If not already specified, select <b>HelloWorld/src</b> as the source folder. Enter <b>HelloWorld</b> for the class name, select the checkbox to create the <b>main()</b> method, then click <b>Finish</b>.<br/>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    27
<br/>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    28
The Java editor will automatically open showing your new class.
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    29
      </description>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    30
      <command serialization="org.eclipse.ui.newWizard(newWizardId=org.eclipse.jdt.ui.wizards.NewClassCreationWizard)" required="false" translate="">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    31
      </command>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    32
   </item>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    33
   <item title="Add a print statement" dialog="false" skip="false" href="/org.eclipse.jdt.doc.user/concepts/concept-java-editor.htm">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    34
      <description>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    35
         Now that you have your HelloWorld class, in the <b>main()</b> method, add the following statement:<br/>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    36
<br/>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    37
System.out.println(&quot;Hello world!&quot;);<br/>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    38
<br/>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    39
Then <b>save</b> your changes; the class will automatically compile upon saving.
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    40
      </description>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    41
   </item>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    42
   <item title="Run your Java application" dialog="false" skip="false" href="/org.eclipse.jdt.doc.user/gettingStarted/qs-12.htm">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    43
      <description>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    44
         To <b>run</b> your application, right-click on your class in the Package Explorer and select <b>Run As</b> &gt; <b>Java Application</b>. The <b>Console</b> view should appear at the bottom and display the &quot;Hello, world!&quot; output.<br/>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    45
<br/>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    46
Congratulations! You have successfully created a Hello World
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    47
application!
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    48
      </description>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    49
   </item>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    50
</cheatsheet>