You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2019/01/07 20:29:57 UTC

[GitHub] vieiro closed pull request #77: Sample kb/docs/java/quickstart.html

vieiro closed pull request #77: Sample kb/docs/java/quickstart.html
URL: https://github.com/apache/incubator-netbeans-website/pull/77
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/netbeans.apache.org/src/content/kb/docs/java/netbeans-stamp-80-74-73.png b/netbeans.apache.org/src/content/kb/docs/java/netbeans-stamp-80-74-73.png
new file mode 100644
index 00000000..ed3512d1
Binary files /dev/null and b/netbeans.apache.org/src/content/kb/docs/java/netbeans-stamp-80-74-73.png differ
diff --git a/netbeans.apache.org/src/content/kb/docs/java/new-proj.png b/netbeans.apache.org/src/content/kb/docs/java/new-proj.png
new file mode 100644
index 00000000..2ad35a64
Binary files /dev/null and b/netbeans.apache.org/src/content/kb/docs/java/new-proj.png differ
diff --git a/netbeans.apache.org/src/content/kb/docs/java/proj-wizard-small.png b/netbeans.apache.org/src/content/kb/docs/java/proj-wizard-small.png
new file mode 100644
index 00000000..501484a8
Binary files /dev/null and b/netbeans.apache.org/src/content/kb/docs/java/proj-wizard-small.png differ
diff --git a/netbeans.apache.org/src/content/kb/docs/java/proj-wizard.png b/netbeans.apache.org/src/content/kb/docs/java/proj-wizard.png
new file mode 100644
index 00000000..9e1aead7
Binary files /dev/null and b/netbeans.apache.org/src/content/kb/docs/java/proj-wizard.png differ
diff --git a/netbeans.apache.org/src/content/kb/docs/java/proj-wizard2-small.png b/netbeans.apache.org/src/content/kb/docs/java/proj-wizard2-small.png
new file mode 100644
index 00000000..16eadeab
Binary files /dev/null and b/netbeans.apache.org/src/content/kb/docs/java/proj-wizard2-small.png differ
diff --git a/netbeans.apache.org/src/content/kb/docs/java/proj-wizard2.png b/netbeans.apache.org/src/content/kb/docs/java/proj-wizard2.png
new file mode 100644
index 00000000..43bccc02
Binary files /dev/null and b/netbeans.apache.org/src/content/kb/docs/java/proj-wizard2.png differ
diff --git a/netbeans.apache.org/src/content/kb/docs/java/quickstart.asciidoc b/netbeans.apache.org/src/content/kb/docs/java/quickstart.asciidoc
new file mode 100644
index 00000000..230ec752
--- /dev/null
+++ b/netbeans.apache.org/src/content/kb/docs/java/quickstart.asciidoc
@@ -0,0 +1,209 @@
+// 
+//     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
+//     regarding copyright ownership.  The ASF licenses this file
+//     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
+//     KIND, either express or implied.  See the License for the
+//     specific language governing permissions and limitations
+//     under the License.
+//
+
+= quickstart
+:jbake-type: page
+:jbake-tags: old-site, needs-review
+:jbake-status: published
+:keywords: Apache NetBeans  quickstart
+:description: Apache NetBeans  quickstart
+:toc: left
+:toc-title:
+
+== NetBeans IDE Java Quick Start Tutorial
+
+Welcome to NetBeans IDE!
+
+This tutorial provides a very simple and quick introduction to the NetBeans IDE workflow by walking you through the creation of a simple "Hello World" Java console application. Once you are done with this tutorial, you will have a general knowledge of how to create and run applications in the IDE.
+
+This tutorial takes less than 10 minutes to complete.
+
+After you finish this tutorial, you can move on to the learning trails, which are linked from the link:../../index.html[Documentation, Training &amp; Support] page. The learning trails provide comprehensive tutorials that highlight a wider range of IDE features and programming techniques for a variety of application types. If you do not want to do a "Hello World" application, you can skip this tutorial and jump straight to the learning trails.
+
+*Contents*
+
+image:netbeans-stamp-80-74-73.png[title="Content on this page applies to the NetBeans IDE 7.2 and later"]
+
+* link:#setup[Setting Up the Project]
+* link:#code[Adding Code to the Generated Source File]
+* link:#run[Compiling and Running the Application]
+* link:#build[Building and Deploying the Application]
+* link:#nextsteps[Next Steps]
+
+*To complete this tutorial, you need the following software and resources.*
+
+|===
+|Software or Resource |Version Required 
+
+|link:https://netbeans.org/downloads/index.html[NetBeans IDE] |version 7.2, 7.3, 7.4, or 8.0 
+
+|link:http://java.sun.com/javase/downloads/index.jsp[Java Development Kit (JDK)] |version 6, 7, or 8 
+|===
+
+=== Setting Up the Project
+
+To create an IDE project:
+
+1. Start NetBeans IDE.
+2. In the IDE, choose File > New Project, as shown in the figure below.
+
+image:new-proj.png[]
+
+3. In the New Project wizard, expand the Java category and select Java Application as shown in the figure below. Then click Next.
+
+link:proj-wizard.png[image:proj-wizard-small.png[]]
+
+4. In the Name and Location page of the wizard, do the following (as shown in the figure below):
+* In the Project Name field, type `HelloWorldApp`.
+* Leave the Use Dedicated Folder for Storing Libraries checkbox unselected.
+* In the Create Main Class field, type `helloworldapp.HelloWorldApp`.
+
+link:proj-wizard2.png[image:proj-wizard2-small.png[]]
+
+5. Click Finish.
+
+The project is created and opened in the IDE. You should see the following components:
+
+* The Projects window, which contains a tree view of the components of the project, including source files, libraries that your code depends on, and so on.
+* The Source Editor window with a file called `HelloWorldApp` open.
+* The Navigator window, which you can use to quickly navigate between elements within the selected class.
+
+link:proj-opened.png[image:proj-opened-small.png[]]
+
+=== Adding Code to the Generated Source File
+
+Because you have left the Create Main Class checkbox selected in the New Project wizard, the IDE has created a skeleton main class for you. You can add the "Hello World!" message to the skeleton code by replacing the line:
+
+[source,java]
+----
+
+
+            // TODO code application logic here
+        
+----
+
+with the line:
+
+[source,java]
+----
+
+
+            System.out.println("Hello World!");
+        
+----
+
+Save the change by choosing File > Save.
+
+The file should look something like the following code sample.
+
+[source,java]
+----
+
+
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package helloworldapp;
+
+/**
+ *
+ * @author <your name>
+ */
+public class HelloWorldApp {
+
+    /**
+     * @param args the command line arguments
+     */
+    public static void main(String[] args) {
+            System.out.println("Hello World!");
+    }
+
+}
+
+        
+----
+
+=== Compiling and Running the Program
+
+Because of the IDE's Compile on Save feature, you do not have to manually compile your project in order to run it in the IDE. When you save a Java source file, the IDE automatically compiles it.
+
+The Compile on Save feature can be turned off in the Project Properties window. Right-click your project, select Properties. In the Properties window, choose the Compiling tab. The Compile on Save checkbox is right at the top. Note that in the Project Properties window you can configure numerous settings for your project: project libraries, packaging, building, running, etc.
+
+*To run the program:*
+
+* Choose Run > Run Project.
+
+The next figure shows what you should now see.
+
+image:run-output.png[]
+
+Congratulations! Your program works!
+
+If there are compilation errors, they are marked with red glyphs in the left and right margins of the Source Editor. The glyphs in the left margin indicate errors for the corresponding lines. The glyphs in the right margin show all of the areas of the file that have errors, including errors in lines that are not visible. You can mouse over an error mark to get a description of the error. You can click a glyph in the right margin to jump to the line with the error.
+
+=== Building and Deploying the Application
+
+Once you have written and test run your application, you can use the Clean and Build command to build your application for deployment. When you use the Clean and Build command, the IDE runs a build script that performs the following tasks:
+
+* Deletes any previously compiled files and other build outputs.
+* Recompiles the application and builds a JAR file containing the compiled files.
+
+*To build your application:*
+
+* Choose Run > Clean and Build Project.
+
+You can view the build outputs by opening the Files window and expanding the `HelloWorldApp` node. The compiled bytecode file `HelloWorldApp.class` is within the `build/classes/helloworldapp` subnode. A deployable JAR file that contains the `HelloWorldApp.class` is within the `dist` node.
+
+image:files-window.png[]
+
+You now know how to accomplish some of the most common programming tasks in the IDE.
+
+For information on how to run the application from the command line, see the link:javase-deploy.html#startapp[Starting Your Java Application] chapter of the Packaging and Distributing Java Applications tutorial.
+
+link:/about/contact_form.html?to=3&subject=Feedback:%20NetBeans%20IDE%20Java%20Quick%20Start%20Tutorial[Send Feedback on This Tutorial]
+
+
+=== See Also
+
+For information on creating and working with standard and free-form Java projects, see link:http://www.oracle.com/pls/topic/lookup?ctx=nb8000&id=NBDAG366[Creating Java Projects] in _Developing Applications with NetBeans IDE_.
+
+To learn more about the IDE workflow for developing Java applications, including classpath management, see link:javase-intro.html[Developing General Java Applications].
+
+For detailed instructions on how to compile and run a simple "Hello World!" application on your operating system, see the link:http://docs.oracle.com/javase/tutorial/getStarted/cupojava/index.html[The "Hello World" Application] lesson of the Java Tutorials.
+
+To find information specific to the kind of applications you are developing, use the NetBeans IDE learning trail for that type of application. Each learning trail contains a series of tutorials and guides that range in scope from basic to advanced. The following learning trails are available:
+
+|===
+|* link:../../trails/java-se.html[General Java Development]
+* link:../../trails/tools.html[Integration with External Tools and Services]
+* link:../../trails/matisse.html[Java GUI Applications]
+* link:../../trails/web.html[Web Services Applications]
+* link:../../trails/java-ee.html[Java EE &amp; Java Web Applications]
+ |
+
+* link:../../trails/php.html[PHP and HTML5 Applications]
+* link:../../trails/platform.html[NetBeans Platform and Module Development]
+* link:../../trails/cnd.html[C/C++ Applications]
+* link:../../trails/mobility.html[Mobile Applications]
+ 
+|===
+
+NOTE: This document was automatically converted to the AsciiDoc format on 2018-03-13, and needs to be reviewed.
diff --git a/netbeans.apache.org/src/content/kb/docs/java/run-output.png b/netbeans.apache.org/src/content/kb/docs/java/run-output.png
new file mode 100644
index 00000000..45f13c32
Binary files /dev/null and b/netbeans.apache.org/src/content/kb/docs/java/run-output.png differ


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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