This is an automated email from the ASF dual-hosted git repository.

geertjan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-netbeans-website.git


The following commit(s) were added to refs/heads/master by this push:
     new 5389ce5  Rewritten javase-intro.asciidoc, "Developing General Java 
Applications" (#322)
5389ce5 is described below

commit 5389ce5dddfa82f062f64d11691d6a963cb4697b
Author: JeremyCavanagh <[email protected]>
AuthorDate: Sun Feb 24 20:35:40 2019 +0100

    Rewritten javase-intro.asciidoc, "Developing General Java Applications" 
(#322)
    
    * Rewritten document to include macOS details
    
    * Revised image
    
    * Added Linux as suggested by Laszlo
    
    * Revised formatting for Windows/Linux,macOS sections
    
    * Corrected revision date
    
    * Revised formatting
    
    * minor typo
    
    * Minor typos
    
    * My second submission
---
 .../src/content/kb/docs/java/javase-intro.asciidoc | 361 ++++++++++++++-------
 1 file changed, 239 insertions(+), 122 deletions(-)

diff --git a/netbeans.apache.org/src/content/kb/docs/java/javase-intro.asciidoc 
b/netbeans.apache.org/src/content/kb/docs/java/javase-intro.asciidoc
index bbd4b5e..b56a5ea 100644
--- a/netbeans.apache.org/src/content/kb/docs/java/javase-intro.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/java/javase-intro.asciidoc
@@ -1,4 +1,4 @@
-// 
+//
 //     Licensed to the Apache Software Foundation (ASF) under one
 //     or more contributor license agreements.  See the NOTICE file
 //     distributed with this work for additional information
@@ -6,9 +6,9 @@
 //     to you under the Apache License, Version 2.0 (the
 //     "License"); you may not use this file except in compliance
 //     with the License.  You may obtain a copy of the License at
-// 
+//
 //       http://www.apache.org/licenses/LICENSE-2.0
-// 
+//
 //     Unless required by applicable law or agreed to in writing,
 //     software distributed under the License is distributed on an
 //     "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -17,12 +17,14 @@
 //     under the License.
 //
 
+//=============================================== The Title and Metadata 
(Start)
+
 = Developing General Java Applications
 :jbake-type: tutorial
-:jbake-tags: tutorials 
+:jbake-tags: tutorials
 :jbake-status: published
+:reviewed: 2019-02-24
 :syntax: true
-:icons: font
 :source-highlighter: pygments
 :icons: font
 :toc: left
@@ -30,65 +32,112 @@
 :description: Developing General Java Applications - Apache NetBeans
 :keywords: Apache NetBeans, Tutorials, Developing General Java Applications
 
-The following short tutorial takes you through some of the basic steps of 
developing a Java SE application in NetBeans IDE. This tutorial assumes you 
already have some familiarity with developing Java applications. Along the way, 
you will see some of the IDE features that simplify application development.
+//================================================= The Title and Metadata 
(End)
+
+//============================================================= Preamble 
(Start)
+
+The following short tutorial takes you through some of the basic steps of 
developing a Java SE application in  the NetBeans IDE. This tutorial assumes 
you already have some familiarity with developing Java applications. Along the 
way, you will see some of the IDE's features that simplify application 
development.
 
 You will create an application that converts several words into a single word 
that contains one letter from each of the other words. The resulting word is 
called an _acrostic_.
 
-This tutorial takes approximately 30 minutes to complete. If you would like to 
do a quicker "Hello World" tutorial, see the link:quickstart.html[+NetBeans IDE 
Java Quick Start Tutorial+].
+This tutorial takes approximately 30 minutes to complete. If you would like to 
do a quicker *Hello World* tutorial, see the link:quickstart.html[+NetBeans IDE 
Java Quick Start Tutorial+].
+
+//=============================================================== Preamble 
(End)
+
+//======================================================== Project Setup 
(Start)
 
-== Project Setup 
+== Project Setup
 
 The application you create will contain two projects:
 
-* A Java Class Library project in which you will create a utility class.
-* A Java Application project with a main class that implements a method from 
the library project's utility class.
+* A Java Class Library project, *MyLib*, in which you will create a utility 
class.
+* A Java Application project, *MyApp*, with a main class that implements a 
method from the library project's utility class.
 
-After you create the projects, you will add the library project to the 
classpath of the application project. Then you will code the application. The 
library project will contain a utility class with an `acrostic` method. The 
`acrostic` method takes an array of words as a parameter and then generates an 
acrostic based on those words. The MyApp project will contain a main class that 
calls the `acrostic` method and passes the words that are entered as arguments 
when the application is run.
+After you create the projects, you will add the library project, *MyLib*, to 
the classpath of the application project, *MyApp*. Then you will code the 
application. The library project will contain a utility class with a method 
named `acrostic` . The method `acrostic` takes an array of words as a parameter 
and then generates an acrostic based on those words. The *MyApp* project will 
contain a class *Main* that calls method `acrostic` and passes the words that 
are entered as arguments when [...]
 
 NOTE: Strictly speaking, two projects are not needed for such a simple 
application. This tutorial uses two projects to demonstrate features that you 
might need for a more complex application.
 
+//==============================================================================
+
 === Creating a Java Class Library Project
 
-1. Choose File > New Project (Ctrl-Shift-N). Under Categories, select Java. 
Under Projects, select Java Class Library. Click Next.
-2. Under Project Name, type `MyLib`. Change the Project Location to any 
directory on your computer. From now on, this tutorial refers to this directory 
as `_NetBeansProjects_`.
+To open a new Java project, press:
+
+[grid="none",frame="none",width="75%",cols="1,4"]
+|===
+|*Windows*(TM)/Linux |`Ctrl-Shift-N`
+|*macOS*(TM) |`Command-Shift-N`
+|===
+
+or, select *File > New Project...* from the menu bar. Then *Choose Project* by 
selecting *Categories: Java* and *Projects: Java Class Library*, then click 
*Next >*.
 
-NOTE: The path specified above should appear as follows in the Project Folder 
field of the wizard: `` /`_NetBeansProjects_`/MyLib/ ``
+For *Name and Location*, set *Project Name: MyLib*. Change *Project Location:* 
to any directory on your computer. From now on, this tutorial refers to this 
directory as `_NetBeansProjects_`.
 
-3. (Optional) Select the Use Dedicated Folder for Storing Libraries checkbox 
and specify the location for the libraries folder. See 
link:http://www.oracle.com/pls/topic/lookup?ctx=nb8000&id=NBDAG455[+Sharing a 
Library with Other Users+] in _Developing Applications with NetBeans IDE_ for 
more information on this option.
-4. Click Finish. The MyLib project opens in both the Projects window and the 
Files window.
+The specified path is then shown as *Project Folder: `` 
/`_NetBeansProjects_`/MyLib ``*
+
+Optionally, select *Use Dedicated Folder for Storing Libraries* checkbox and 
specify the location for the *libraries Folder:*. See 
link:http://www.oracle.com/pls/topic/lookup?ctx=nb8000&id=NBDAG455[+Sharing a 
Library with Other Users+] in _Developing Applications with NetBeans IDE_ for 
more information on this option.
+
+Finally, click *Finish*. The MyLib project will be created and opens in the 
*Projects* window.
+
+//==============================================================================
 
 === Creating a Java Application Project
 
-1. Choose File > New Project. Under Categories, select Java. Under Projects, 
select Java Application. Click Next.
-2. Under Project Name, type `MyApp`. Make sure the Project Location is set to 
`_NetBeansProjects_`.
-3. (Optional) Check the Use Dedicated Folder for Storing Libraries checkbox.
-4. Enter `acrostic.Main` as the main class.
-5. Ensure that the Create Main Class checkbox is checked.
-6. Click Finish. The MyApp project is displayed in the Project window and 
`Main.java` opens in the Source Editor.
+Open a new Java Project, as shown above. Then *Choose Project* by selecting 
*Categories: Java* and *Projects: Java Application*, then click *Next >*.
+
+for *Name and Location*, set *Project Name: MyApp*. Make sure the Project 
Location is set to `_NetBeansProjects_`.
+
+Optionally, select the *Use Dedicated Folder for Storing Libraries* checkbox.
+
+Ensure that the *Create Main Class* checkbox is selected and, enter 
*acrostic.Main* as the main class.
+
+Finally, click *Finish*. The MyApp project is displayed in the *Projects* 
window and *Main.java* opens in the source editor.
+
+//==============================================================================
 
 === Configuring the Compilation Classpath
 
-Since MyApp is going to depend on a class in MyLib, you have to add MyLib to 
the classpath of MyApp. Doing so also ensures that classes in the MyApp project 
can refer to classes in the MyLib project without causing compilation errors. 
In addition, this enables you to use code completion in the MyApp project to 
fill in code based on the MyLib project. In the IDE, the classpath is visually 
represented by the Libraries node.
+Since class *MyApp* is going to depend on class *MyLib*, you have to add 
*MyLib* to the classpath of *MyApp*. Doing so also ensures that classes in the 
*MyApp Project* can refer to classes in the *MyLib Project* without causing 
compilation errors. In addition, this enables you to use code completion in the 
*MyApp Project* to fill in code based on the *MyLib Project*. In the IDE, the 
classpath is visually represented by the *Libraries* node.
 
 *To add the library's utility classes to the project classpath:*
 
-1. In the Projects window, right-click the Libraries node for the MyApp 
project and choose Add Project as shown in the image below.
+In the *Projects* window, right-click the *Libraries* node for the *MyApp* 
project and choose *Add Project...* as shown in the image below.
 
 image::images/addproj.png[]
 
-2. Browse to `_NetBeansProjects_/` and select the `MyLib` project folder. The 
Project JAR Files pane shows the JAR files that can be added to the project. 
Notice that a JAR file for MyLib is listed even though you have not actually 
built the JAR file yet. This JAR file will get built when you build and run the 
MyApp project.
-3. Click Add Project JAR Files.
-4. Expand the Libraries node. The MyLib project's JAR file is added to the 
MyApp project's classpath.
+If necessary, in the *Add Project* window browse to `_NetBeansProjects_` and, 
select the *MyLib* project folder. When you do so, you will see *Project Name: 
MyLib* and, *Project JAR Files: dist/MyLib.jar* can be added to the project.
+
+Notice that a JAR file is shown for *MyLib* even though you have not actually 
built one yet. This JAR file will get built when you build and run the *MyApp* 
project.
+
+Select *Add Project JAR Files* then expand the *Libraries* node of *MyApp* in 
the *Projects* window and, you will see that *MyLib* project's JAR file has 
been added to the *MyApp* project's classpath.
+
+//========================================================== Project Setup 
(End)
+
+//================================ Creating and Editing Java Source Code 
(Start)
 
-== Creating and Editing Java Source Code 
+== Creating and Editing Java Source Code
 
-Now you need to create a Java package and add the method that you will use to 
construct the acrostic. After that you need to implement the `acrostic` method 
in the `Main` class.
+Now you need to create a Java package and, add the method that will construct 
the acrostic. After that you need to implement the method `acrostic` in class 
`Main`.
+
+//==============================================================================
 
 === Creating a Java Package and Class File
 
-1. Right-click the MyLib project node and choose New > Java Class. Type 
`LibClass` as the name for the new class, type `org.me.mylib` in the Package 
field, and click Finish. `LibClass.java` opens in the Source Editor.
-2. In `LibClass.java`, place the cursor on the line after the class 
declaration (`public class LibClass {`.
-3. Type or paste in the following method code: 
+In the *Projects* window, right-click the *MyLib* project node and select *New 
> Java Class...* . Alternatively, regardless of where you are in the project, 
press:
+
+[grid="none",frame="none",width="75%",cols="1,4"]
+|===
+|*Windows(TM)*/Linux |`Ctrl-N`
+|*macOS*(TM) |`Command-N`
+|===
+
+or, select *File > New File...* from the menu bar. Then in the *New File* 
window select: *Project: MyLib*, *Categories: Java* and *File Types: Java 
Class* then click *Next*.
+
+In the *New Java Class* window, type: *Class Name: LibClass* and *Package: 
org.me.mylib*. Click *Finish* and *LibClass.java* opens in the source editor.
+
+In `LibClass.java`, place the cursor on the line after the class declaration 
`public class LibClass {`.
+
+Type or paste in the following method code:
 
 [source,java]
 ----
@@ -105,53 +154,53 @@ Now you need to create a Java package and add the method 
that you will use to co
         return b.toString();
     }
 ----
-4. If the code that you pasted in is not formatted correctly, press 
Alt-Shift-F to reformat the entire file.
-5. Press Ctrl-S to save the file.
+If the code that you pasted in is not formatted correctly, press:
 
-=== Editing a Java File
-
-Now you will add some code to `Main.java`. In doing so, you will see the 
Source Editor's code completion and code template (abbreviation) features.
+[grid="none",frame="none",width="75%",cols="1,4"]
+|===
+|*Windows(TM)*/Linux |`Alt-Shift-F`
+|*macOS*(TM) |`Ctrl-Shift-F`
+|===
 
-1. Select the `Main.java` tab in the Source Editor. If it isn't already open, 
expand MyApp > Source Packages > acrostic in the Projects window and 
double-click `Main.java`.
-2. Delete the `// TODO code application logic here` comment in the `main` 
method.
-3. In place of the comment type the following:
+or, *Source > Format* from the menu bar or, right-click *Format* to reformat 
the entire file. Then save your file:
 
-[source,java]
-----
+[grid="none",frame="none",width="75%",cols="1,4"]
+|===
+|*Windows(TM)*/Linux |`Ctrl-S`
+|*macOS*(TM) |`Command-S`
+|===
 
-String result = Li
-----
+or, select *File > Save* from the menu bar.
 
-Leave the cursor immediately after `Li`. In the next step you will use code 
completion to turn `Li` into `LibClass`.
+//==============================================================================
 
-4. Press Ctrl-Space to open the code completion box.
+=== Editing a Java File
 
-A short list of possible ways to complete the word appears. However, the class 
that you want, `LibClass` might not be there.
+Now you will add some code to class `Main.java`. In doing so, you will see the 
source editor's code completion and, code template features.
 
-5. Press Ctrl-Space again to display a longer list of possible matches.
+Select the `Main.java` tab in the source editor. If it isn't already open, 
select the *Projects* window and expand *MyApp > Source Packages > acrostic* 
and either:  double-click `Main.java` or, right-click and select *Open*.
 
-`LibClass` should be in this list.
+In the method `main`, delete the comment: `// TODO code application logic 
here` and, in its place type the following:
 
-6. Select `LibClass` and press Enter. The IDE fills in the rest of the class 
name and also automatically creates an import statement for the class.
+[source,java]
+----
 
-NOTE: The IDE also opens a box above the code completion box that displays 
Javadoc information for the selected class or package. Since there is no 
Javadoc information for this package, the box displays a "Cannot find Javadoc" 
message.
+String result = Li
+----
 
-7. In the main method, type a period (.) after `LibClass`. The code completion 
box opens again.
-8. Select the `acrostic(String[]args)` method and press Enter. The IDE fills 
in the `acrostic` method and the highlights the `args` parameter.
-9. Press Enter to accept `args` as the parameter.
-10. Type a semicolon (;).
+At this point stop typing but leave the cursor immediately after `Li`. Invoke 
code completion by pressing `Ctrl-Space`, a short list of options appears. 
However, the class that you want, `LibClass` might not be there. If you press 
`Ctrl-Space` again a longer code completion list appears containing `LibClass`, 
select `LibClass` and press *Enter*. The IDE fills in the rest of the class 
name and also automatically creates an import statement for the class.
 
-The final line should look like the following line.
+NOTE: The IDE also opens a box above the code completion box that displays 
Javadoc information for the selected class or package. Since there is no 
Javadoc information for this package, the box displays a "Cannot find Javadoc" 
message.
 
+In the main method, type a period ( `.` ) after `LibClass`, the code 
completion box opens again. Select the `acrostic(String[]args)` method and 
press *Enter*. The IDE fills in the `acrostic` method and highlights the `args` 
parameter, press *Enter* again to accept `args` as the parameter, end the line 
with a semicolon ( `;` ). The line should look, as follows:
 
 [source,java]
 ----
 
 String result = LibClass.acrostic(args);
 ----
-11. Press Enter to start a new line. Then type `sout` and press Tab. The 
`sout` abbreviation expands to `System.out.println(""); `with the cursor 
positioned between the quotation marks. Type `Result =` inside the quotation 
marks and `+ result` after the end quotation mark.
 
-The final line should look like the following line.
+Press *Enter* to start a new line. Then type `sout` and press *Tab*. The 
`sout` abbreviation expands to `System.out.println("");` with the cursor 
positioned between the quotation marks. Type `Result =` inside the quotation 
marks and `+ result` after the end quotation mark. The final line should look 
like the following line.
 
 
 [source,java]
@@ -159,27 +208,32 @@ The final line should look like the following line.
 
 System.out.println("Result = " + result);
 ----
-12. Press Ctrl-S to save the file.
 
-NOTE: `sout` is one of many code templates that are available in the Source 
Editor. To find and edit the list of code templates, choose Tools > Options > 
Editor > Code Template.
+Save the file.
+
+NOTE: `sout` is one of many code templates that are available in the Source 
Editor. To find out how to edit using code templates see, See 
link:http://www.oracle.com/pls/topic/lookup?ctx=nb8000&id=NBDAG455[+Sharing a 
Library with Other Users+] in _Developing Applications with NetBeans IDE_ for 
more information on this option.choose Tools > Options > Editor > Code Template.
+
+//================================== Creating and Editing Java Source Code 
(End)
 
-== Compiling and Running the Application 
+//================================ Compiling and Running the Application 
(Start)
+
+== Compiling and Running the Application
 
 Now you need to set the main class and execution arguments so that you can run 
the project.
 
 NOTE: By default, the projects have been created with the Compile on Save 
feature enabled, so you do not need to compile your code first in order to run 
the application in the IDE. For more information, see 
link:http://www.oracle.com/pls/topic/lookup?ctx=nb8000&id=NBDAG525[+Compiling a 
Single Java File+] in _Developing Applications with NetBeans IDE_.
 
+//==============================================================================
+
 === Setting the Main Class and Execution Arguments
 
 The output of this program is based on arguments that you provide when you run 
the program. As arguments, you will provide five words, from which the acrostic 
"Hello" will be generated. The acrostic is assembled from the first letter of 
the first word, the second letter of the second word, the third letter of the 
third word, and so on.
 
 *To add the arguments for the IDE to use when running the application:*
 
-1. Right-click the MyApp project node, choose Properties, and select the Run 
node in the dialog's left pane.
+From the *Projects* window, right-click the *MyApp* project node and select 
*Properties*. The *Project Properties* window opens,  select the *Categories: 
Run* node in the dialog's left-hand pane. In the right-hand pane set 
*Arguments: However we all feel zealous* and select *OK*.
 
-The main class should already be set to `acrostic.Main`.
-
-2. Type `However we all feel zealous `in the Arguments field and click OK.
+//==============================================================================
 
 === Running the Application
 
@@ -187,25 +241,41 @@ Now that you have created the application and provided 
runtime arguments for the
 
 *To run the application in the IDE:*
 
-1. Right-click the MyApp project node and choose Clean and Build.
-2. Choose Run > Run Project (F6).
+First, press `F11` to clean and build your project or, in the *Projects* 
window right-click the *MyApp* project node and choose *Clean and Build* or, 
select *Run > Clean and Build Project (MyApp)* from the menu bar.
+
+Then, you can press `F6` or, in the *Projects* window right-click the *MyApp* 
project node and choose *Run* or, select *Run > Run Project (MyApp)* from the 
menu bar .
+
+In the *Output* window, you should see the output from the program, `Result = 
Hello`, the acrostic of the phrase that was passed as an argument to the 
program.
 
-In the Output window, you should see the output from the program, `Result = 
Hello ` (the acrostic of the phrase that was passed to the program as an 
argument).
+//================================ Compiling and Running the Application 
(Start)
 
-== Testing and Debugging the Application 
+//================================ Testing and Debugging the Application 
(Start)
+
+== Testing and Debugging the Application
 
 Now you will create and run a test for the project using JUnit and then run 
the application in the IDE's debugger to check for errors. In the JUnit test, 
you will test the LibClass by passing a phrase to the `acrostic` method and 
using an assertion to indicate what you think the result should be.
 
+//==============================================================================
+
 === Creating JUnit Tests
 
-1. Right-click the `LibClass.java` node in the Projects window and choose 
Tools >Create/Update Tests (Ctrl-Shift-U).
-2. In the Create Tests dialog box, click OK to run the command with the 
default options.
+To create a JUnit test, from the *Projects* window select the `LibClass.java` 
node and press:
+
+[grid="none",frame="none",width="75%",cols="1,4"]
+|===
+|*Windows(TM)*/Linux |`Ctrl-Shift-U`
+|*macOS*(TM) |`Command-Shift-U`
+|===
 
-NOTE: If this is the first time you have created JUnit tests in the IDE, you 
will be prompted with the Select JUnit Version dialog box. Press Enter to 
select JUnit 4.x and continue to the Create Tests dialog box.
+or, select *Tools > Create/Update Tests* from the menu bar or, in the 
*Projects* window, right-click the `LibClass.java` node and and select *Tools > 
Create/Update Tests*.
 
-The IDE creates the `org.me.mylib` package and the `LibClassTest.java` file in 
a separate `test` folder. You can find this file by expanding the Test Packages 
node and the `org.me.mylib` subnode.
-3. In `LibClassTest.java`, delete the body of the `public void testAcrostic()` 
method.
-4. In place of the deleted lines, type or paste in the following:
+In the *Create/Update Tests* dialog box, click *OK* to run the command with 
the default options.
+
+In the *Projects* window you will see that the IDE has created the 
`org.me.mylib` package, the `LibClassTest.java` file in the *MyLib > Test 
Packages*  folder and, created the *MyLib > Test Libraries* folder. Finally the 
file `LibClassTest.java` is opened in the editor.
+
+In the *Projects* window, right-click the *Test Libraries* node and select 
*Properties*.  In the *Project Properties - MyLib* window, select *Categories: 
Libraries*. In the right-hand pane select the *Compile Tests* tab and click the 
` *+* ` button. From the pop-up list select *Add Library*, from the *Global 
Libraries* folder select `JUnit 4.x` and click *Add Libray* repeat, this time 
selecting the `Hamcrest 1.x` library.
+
+In `LibClassTest.java`, delete the body of the `public void testAcrostic()` 
method and, in place of the deleted lines, type or paste in the following:
 
 [source,java]
 ----
@@ -214,83 +284,120 @@ System.err.println("Running testAcrostic...");
 String result = LibClass.acrostic(new String[]{"fnord", "polly", "tropism"});
 assertEquals("Correct value", "foo", result);
 ----
-5. Save the file by pressing Ctrl-S.
+Then *Save* the file.
+
+//==============================================================================
 
 === Running JUnit Tests
 
-1. Select the MyLib project node and choose Run > Test Project (MyLib) or 
press Alt-F6. The` MyLib (test)` tab opens in the Output window. The JUnit test 
cases are compiled and run. The JUnit test result shows that the test passes.
-2. You can also run a single test file rather than testing the entire project. 
Select the `LibClass.java` tab in the Source Editor and choose Run > Test File.
+In the *Projects* window, select the *MyLib* project node and press:
+
+[grid="none",frame="none",width="75%",cols="1,4"]
+|===
+|*Windows(TM)*/Linux |`Alt-F6`
+|*macOS*(TM) |`Ctrl-F6`
+|===
+
+or, select *Run > Test Project (MyLib)* from the menu bar or, right-click the 
*MyLib* project node and select *Test*. A notification pops up telling you 
"Tests completed successfully for project: MyLib", and then instructs you to 
open the *Test Results* window, were you will receive confirmation of success.
 
-The JUnit API documentation is available from the IDE. Choose Help > Javadoc 
References > JUnit API.
+You can also run a single test file rather than testing the entire project. 
Right-click the `LibClass.java` node in the *Projects* window and choose *Run > 
Test File*. Alternatively, if `LibClassTest.java` is open in the editor, select 
*Run > Test File* from the menu bar.
 
-NOTE: If this is the first time you access Javadoc in the IDE, you need to 
first choose Help > Javadoc References > More Javadoc. Click Cancel in the 
Javadoc References dialog box. Then choose Help > Javadoc References > JUnit 
API.
+The JUnit API documentation is available from the IDE. To look for Javadoc 
references, select *Help > Javadoc References* from the menu bar and select 
`JUnit`.
+
+If this is the first time you try to access Javadoc in the IDE, you need to 
first choose  *Help > Javadoc References > More Javadoc*.
 
 You can learn more about JUnit by visiting 
link:http://www.junit.org[+http://www.junit.org+]
 
+//==============================================================================
+
 === Debugging the Application
 
 In this section, you will use the debugger to step through the application and 
watch the values of variables change as the acrostic is assembled.
 
 *To run the application in the debugger:*
 
-1. In the `LibClass.java` file, go to the `acrostic` method and place the 
insertion point anywhere inside `b.append(args[i].charAt(i));`. Then press 
Ctrl-F8 to set a breakpoint.
-2. Select the MyApp project node and choose Debug > Debug Project (Ctrl-F5). 
The IDE opens the Debugger windows and runs the project in the debugger until 
the breakpoint is reached.
-3. Select the Local Variables window in the bottom of the IDE and expand the 
`args` node. The array of strings contains the phrase you entered as the 
command arguments.
-4. Press F7 (or choose Debug > Step Into) to step through the program and 
watch the `b` variable change as the acrostic is constructed.
+In the `LibClass.java` file, go to the `acrostic` method and place the 
insertion point anywhere inside `b.append(args[i].charAt(i));`, then set a 
breakpoint by pressing:
+
+[grid="none",frame="none",width="75%",cols="1,4"]
+|===
+|*Windows(TM)*/Linux |`Ctrl-F8`
+|*macOS*(TM) |`Command-F8`
+|===
+
+or, select *Debug > Toggle Line Breakpoint* from the menu bar or, in the left 
hand margin right-click the specified line and select *Breakpoint > Toggle Line 
Breakpoint*.
+
+Select the *MyApp* project node in the *Projects* window and, press:
+
+[grid="none",frame="none",width="75%",cols="1,4"]
+|===
+|*Windows*(TM)/Linux |`Ctrl-F5`
+|*macOS*(TM) |`Shift-F5`
+|===
+
+or, select *Debug > Debug Project (MyApp)* from the menu bar or, right-click 
and select *Debug*. The IDE opens the *Debugging* window and runs the project 
in the debugger until the breakpoint is reached.
+
+Select the *Variables* window in the bottom of the IDE and expand the `args` 
node. The array of strings contains the phrase you entered as the command 
arguments.
+
+Press `F7` or, select *Debug > Step Into* from the menu bar to step through 
the program and watch the `b` variable change as the acrostic is constructed.
 
 When the program reaches the end, the debugger windows close.
 
 For more information, see link:junit-intro.html[+Writing JUnit Tests in 
NetBeans IDE+].
 
+//================================== Testing and Debugging the Application 
(End)
+
+//================== Building, Running, and Distributing the Application 
(Start)
+
 == Building, Running, and Distributing the Application
 
 Once you are satisfied that your application works properly, you can prepare 
the application for deployment outside of the IDE. In this section you will 
build the application's JAR file and then run the JAR file from the command 
line.
 
+//==============================================================================
+
 === Building the Application
 
-The main build command in the IDE is the Clean and Build command. The Clean 
and Build command deletes previously compiled classes and other build artifacts 
and then rebuilds the entire project from scratch.
+The main build command in the IDE is the *Clean and Build* command. The *Clean 
and Build* command deletes previously compiled classes and other build 
artifacts and then rebuilds the entire project from scratch.
 
 NOTE: There is also a Build command, which does not delete old build 
artifacts, but this command is disabled by default. See 
link:http://www.oracle.com/pls/topic/lookup?ctx=nb8000&id=NBDAG512[+About 
Building Java Projects+] in _Developing Applications with NetBeans IDE_ for 
more information.
 
-*To build the application:*
+To build the application, press `Shift-F11` or, if `Main.java` is open in the 
editor, select *Run > Clean and Build Project (MyApp)* from the menu bar or, in 
the *projects* window right-click on the *MyApp* node and select *Clean and 
Build*.
 
-* Choose Run > Clean and Build Project (Shift-F11).
-
-Output from the Ant build script appears in the Output window. If the Output 
window does not appear, you can open it manually by choosing Window > Output > 
Output.
+Output from the Ant build script appears in the *Output* window, If the window 
does not appear automatically, open it manually by choosing *Window > Output* 
from the menu bar.
 
 When you clean and build your project, the following things occur:
 
-* Output folders that have been generated by previous build actions are 
deleted ("cleaned"). (In most cases, these are the `build` and `dist` folders.)
-* `build` and `dist` folders are added to your project folder (hereafter 
referred to as the _PROJECT_HOME_ folder). You can view these folders in the 
Files window.
+* Output folders that have been generated by previous build actions are 
deleted, " *cleaned* ". In most cases, these are the `build` and `dist` folders.
+
+* `build` and `dist` folders are added to your project folder, hereafter 
referred to as the _PROJECT_HOME_ folder. You can view these folders in the 
Files window.
+
 * All of the sources are compiled into `.class` files, which are placed into 
the `_PROJECT_HOME_/build` folder.
+
 * A JAR file containing your project is created inside the 
`_PROJECT_HOME_/dist` folder.
-* If you have specified any libraries for the project (in addition to the 
JDK), a `lib` folder is created in the `dist` folder. The libraries are copied 
into `dist/lib`.
-* The manifest file in the JAR is updated to include entries that designate 
the main class and any libraries that are on the project's classpath.
 
-NOTE: You can view the contents of the manifest in the IDE's Files window. 
After you have built your project, switch to the Files window and navigate to 
`dist/MyApp.jar`. Expand the node for the JAR file, expand the `META-INF` 
folder, and double-click `MANIFEST.MF` to display the manifest in the Source 
Editor.
+* If you have specified any libraries for the project, in addition to the JDK, 
a `lib` folder is created in the `dist` folder. The libraries are copied into 
`dist/lib`.
 
+* The manifest file in the JAR is updated to include entries that designate 
the main class and any libraries that are on the project's classpath.
 
-[source,java]
-----
+NOTE: You can view the contents of the manifest in the IDE's *Files* window. 
After you have built your project, switch to the Files window and navigate to 
`dist/MyApp.jar`. Expand the node for the JAR file, expand the `META-INF` 
folder, and double-click `MANIFEST.MF` to display the manifest in the Source 
Editor.
 
-Main-Class: acrostic.Main
-            Class-Path: lib/MyLib.jar
-----
+To find more about manifest files, you can read 
link:http://java.sun.com/docs/books/tutorial/deployment/jar/manifestindex.html[+this
 chapter+] from the Java Tutorial.
 
-(To find more about manifest files, you can read 
link:http://java.sun.com/docs/books/tutorial/deployment/jar/manifestindex.html[+this
 chapter+] from the Java Tutorial.)
+//==============================================================================
 
 === Running the Application Outside of the IDE
 
 *To run the application outside of the IDE:*
 
-1. On your system, open up a command prompt or terminal window.
-2. In the command prompt, change directories to the `MyApp/dist` directory.
-3. At the command line, type the following statement:
+On your system, open up a command prompt or terminal window.
+
+In the command prompt, change directories to the `MyApp/dist` directory.
+
+At the command line, type the following statement:
 
 [source,java]
 ----
 
-java -jar MyApp.jar However we all feel zealous    
+java -jar MyApp.jar However we all feel zealous
 ----
 
 The application then executes and returns the following output as shown in the 
image below:
@@ -300,12 +407,10 @@ The application then executes and returns the following 
output as shown in the i
 ----
 
 Result = Hello
-            
+
 ----
-[.feature]
---
-image::images/command-prompt-smaller.png[role="left", 
link="images/command-prompt.png"]
---
+
+//==============================================================================
 
 === Distributing the Application to Other Users
 
@@ -313,34 +418,46 @@ Now that you have verified that the application works 
outside of the IDE, you ar
 
 *To distribute the application:*
 
-1. On your system, create a zip file that contains the application JAR file 
(`MyApp.jar`) and the accompanying `lib` folder that contains `MyLib.jar`.
-2. Send the file to the people who will use the application. Instruct them to 
unpack the zip file, making sure that the `MyApp.jar` file and the `lib` folder 
are in the same folder.
-3. Instruct the users to follow the steps in the <<running-outside-IDE,Running 
the Application Outside of the IDE>> section above.
+On your system, create a zip file that contains the application JAR file 
(`MyApp.jar`) and the accompanying `lib` folder that contains `MyLib.jar`.
+
+Send the file to the people who will use the application. Instruct them to 
unpack the zip file, making sure that the `MyApp.jar` file and the `lib` folder 
are in the same folder.
+
+Instruct the users to follow the steps in the <<running-outside-IDE,Running 
the Application Outside of the IDE>> section above.
+
+//==================== Building, Running, and Distributing the Application 
(End)
+
+//=================================================== Other Common Tasks 
(Start)
 
 == Other Common Tasks
 
 You have now completed the main part of the tutorial, but there are still some 
basic tasks that have not been covered. This section includes a few of those 
tasks.
 
+//==============================================================================
+
 === Making the Javadoc Available in the IDE
 
-To view the JavaSE API documentation in the NetBeans IDE, use the Source > 
Show Documentation command or choose Window > IDE Tools > Javadoc Documentation 
from the main menu to view API documentation in a separate window.
+To view the Java SE API documentation in the NetBeans IDE, select either: 
*Source > Show Documentation* or, *Window > IDE Tools > Javadoc Documentation* 
from the menu bar.
 
 However, for some third-party libraries, API documentation is not available. 
In these cases, the Javadoc resources must be manually associated with the IDE.
 
-*To make the Javadoc API documentation available for the Show Javadoc command:*
+If you have not already installed the Javadoc for your JDK then go to:
 
-1. Download the Javadoc API documentation source (see the 
link:http://wiki.netbeans.org/FaqJavaDoc#Adding_the_JDK_Javadoc_to_the_NetBeans_IDE[+FaqJavaDoc+]
 page for additional details).
-2. Choose Tools > Java Platforms.
-3. Click the Javadoc tab.
-4. Click the Add ZIP/Folder button and navigate to the zip file or the folder 
that contains the Javadoc API documentation on your system. Select the zip file 
or the folder and click the Add ZIP/Folder button.
-5. Click Close.
+link:https://www.oracle.com/technetwork/java/javase/downloads/index.html[]
+
+and, download the file.
+
+To install, select *Tools > Java Platforms* from the menu bar and, in the 
*Java Platform Manager* window select the *Javadoc* tab and click *Add 
ZIP/Folder...*. Navigate to the download file, select and then click the *Add 
ZIP/Folder* button, finally click *Close*.
+
+//==============================================================================
 
 === Generating Javadoc for a Project
 
 You can generate compiled Javadoc documentation for your project based on 
Javadoc comments that you have added to your classes.
 
-*To generate Javadoc documentation for a project:*
+To generate Javadoc documentation for a project:
+
+From the *Projects* window select the *MyLib* project node then select *Run > 
Generate Javadoc (MyLib)* from the menu bar.
 
-1. Select the MyLib project.
-2. Choose Run > Generate Javadoc for "MyLib" from the IDE's main menu. 
 The generated Javadoc is added to the `dist` folder of the project. In 
addition, the IDE opens a web browser that displays the Javadoc.
+
+//===================================================== Other Common Tasks 
(End)


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to