NetBeans IDE Field Guide

Transcription

1 NetBeans IDE Field Guide Copyright 2005 Sun Microsystems, Inc. All rights reserved. Table of Contents Downloading the IDE...1 Installing the IDE...2 Setting a Proxy...3 First NetBeans IDE Project...3 Trying Out NetBeans IDE With Sample Code...7 Download, Installation, and First Project This chapter provides the basic information that you need to get NetBeans IDE running on your system and then runs you through creation of a very simple project to get you started. Additional basic information follows in Chapter 2: NetBeans IDE Fundamentals. Downloading the IDE You can download NetBeans IDE from the netbeans.org Web site or NetBeans IDE the java.sun.com site. Visit for a list of and links to all downloads. NetBeans IDE 4.1 is available in the following distributions: The basic IDE distribution. This distribution includes support for developing general Java libraries, rich client applications, Web applications, and enterprise tier applications. You can get this distribution as an installer (for Microsoft Windows, Solaris, Linux, and Mac OS systems) or as an archive distribution (zip file or tar file). Use this distribution if you already have the JDK installed on your system (must be version 1.4.2, 5.0, or compatible) and you do not need to download the Sun Java Application Server (either because you already have it or NetBeans IDE Field Guide, Download, Installation, and First Project, 1

2 because you do not need it for the applications you are developing). The basic IDE distribution bundled with the Sun Java System Application Server Platform Edition. This is the most convenient download if you want to immediately start developing and deploying applications to an application server (and you do not yet have the Sun Java System Application server). The basic IDE distribution bundled with J2SE JDK 5.0. This is a convenient download if you do not already have the JDK installed on your system. Both the JDK and the IDE are installed at the same time. However, this bundle might not contain the very latest update version of the JDK or IDE. NetBeans IDE Tip Having just the Java Runtime Environment (JRE) installed on your system is not sufficient for running NetBeans IDE. You need to have the JDK, which includes a copy of the JRE. The IDE relies on development tools provided by the JDK, such as the javac compiler, and takes advantage of other parts of that download, such as JDK sources that it includes. You can to to to find and download the latest version of the JDK. In addition, there are the following optional add-on installers for NetBeans IDE: NetBeans Mobility Pack. This installer adds support for developing applications based on J2ME technology for mobile devices. NetBeans Profiler. This pack adds the ability to profile your application's performance using dynamic bytecode instrumentation. As the name add-on implies, these installers only work if you have a compatible version of NetBeans IDE already installed on your system. Installing the IDE Installing the IDE is simple and is basically composed of these steps: 1. Make sure that you have a suitable JDK version installed on your system. For NetBeans IDE 4.1, the JDK version must be or higher. If you do not have a suitable JDK version on your system, install that first or download a JDK/NetBeans IDE bundle. 2. If you are running on the Solaris or Linux operating systems, changing the permissions on the installer file to make it executable (if necessary). 3. Double-clicking the installer (or, on Solaris or Linux, launching the installer from the command line) and then stepping through the installer wizard. If you download one of the bundle distributions, the bundled products are unified by a single installer. That's pretty much all you have to do. The installer guides you through selecting a JDK on your system to run the IDE on and (optionally) creates desktop icons and Start menu items to launch the IDE from. See Chapter 7, Configuring your Environment for J2EE Development for information for information on setting up the Sun Java Application System server. NetBeans IDE Field Guide, Download, Installation, and First Project, 2

3 Setting a Proxy Periodically, it is useful for the IDE to have a Web connection. The IDE periodically checks the Web to see if new or updated modules are available. Also, some IDE functions such as Validate XML might rely on resources on the Web. In addition, some Help menu items are links to documentation on the Web. If you work behind a firewall, you might need to configure the IDE to use a proxy for HTTP connections to the Web. The IDE attempts to use your system's proxy. If that does not work, you can set the proxy manually. To manually set a proxy in the IDE: 1. Choose Tools Setup Wizard. 2. In the Web Proxy section of the wizard page, select the Use HTTP Proxy radio button and fill in values for the proxy host and port. First NetBeans IDE Project Once you have started the IDE, you are presented with a welcome window and some other empty windows. To help you make the IDE come alive, this section provides a quick run-through of setting up, compiling, and running a Hello World project. To set up the project: 1. Choose File New Project. 2. In the New Project wizard, expand the General node, select Java Application, and click Next (as shown in Figure 1-1) The Java Application template sets up a basic project and includes a main class. NetBeans IDE Field Guide, Download, Installation, and First Project, 3

4 Figure 1-1 New Project Wizard, Choose Project page 4. In the Name and Location page of the wizard, type HelloWorld as the project name. 5. In the Create Main Class field, change helloworld.main to com.mydomain.myproject.helloworld. (When you enter a fullyqualified class name in this field, the IDE generates directories for each level of the package structure.) Figure 1-2 New Project Wizard, Choose Project page 6. Click Finish. Once you have finished the wizard, the IDE will run a scan of the classpath that has been set for the project to enable features such as code completion to work. The following windows then get populated: The Projects window, which provides access to your sources, any tests you might have, and your classpath (represented through the Libraries and Test Libraries nodes). NetBeans IDE Field Guide, Download, Installation, and First Project, 4

5 Figure 1-3 Projects window with nodes for the HelloWorld project The Navigator window, which provides an easy way for you to view and access members of the currently selected class. The Source Editor, where a tab for the HelloWorld class opens. NetBeans IDE Field Guide, Download, Installation, and First Project, 5

6 Figure 1-4 Source Editor with HelloWorld.java open To modify, build, and run the project: 1. In the Source Editor, click within the main method at the end of the line that reads // TODO code application logic here. 2. Press the Enter key and then type the following line: System.out.println("Hello World!"); 3. Press Ctrl-S to save the application. 4. Press F11 (or choose Build Build Main Project) to compile and package the application. This command triggers an Ant script that the IDE has generated and maintained for the project. The Output window opens and displays the output from the Ant script as it runs through its targets. Figure 1-5 Output Window showing successful building of HelloWorld project NetBeans IDE Field Guide, Download, Installation, and First Project, 6

7 Figure Press F6 (or choose Run Run Main Project) to run the project. The Output window should display a combination of Ant output and the Hello World! message from your application. Output Window showing the successful running of the HelloWorld project. With that, you have created and run an application in the IDE. You can now move on to the next chapter to get a broader overview of the IDE. Or you can skip ahead to Chapter 3 to cut straight to the details of creating and customizing projects. Trying Out NetBeans IDE With Sample Code If you want to check out the features of NetBeans IDE on working code without touching your existing projects or you just want to see what a working project looks like in the IDE, you can open one of the sample projects that come with the IDE. When you create a sample project, the sample code is copied into a directory of your choosing and all necessary project metadata is generated. To create a sample project: 1. Choose File New Project. 2. In the New Project wizard, expand the Samples folder and choose a template from one of the categories and click Next. The General category contains a simple J2SE application. The Web category contains several examples designed to run on the Tomcat server. The BluePrints Solutions category contains examples of useful design patterns for J2EE applications. These examples accompany the BluePrints Solution Catalog that is available from the help menu and which provides documentation for these design patterns in a problem/solution format. NetBeans IDE Field Guide, Download, Installation, and First Project, 7

8 If you have the Mobility Modules installed, a Mobility category also appears and includes samples from the J2ME Wireless Toolkit. 3. Press Ctrl-S to save the application. 4. On the Name and Location page of the wizard, check the generated values for name and location of the project and change them, if you wish. Then click Finish. Once you have created a new sample project, you can view its source code and project structure and build and run that application within the IDE. NetBeans IDE Field Guide, Download, Installation, and First Project, 8

1 Installing jgrasp Among all of the jgrasp Tutorials, this one is expected to be the least read. Most users will download the jgrasp self-install file for their system, doubleclick the file, follow the

How to use the Eclipse IDE for Java Application Development Java application development is supported by many different tools. One of the most powerful and helpful tool is the free Eclipse IDE (IDE = Integrated

Setting up VMware ESXi for 2X VirtualDesktopServer Manual URL: www.2x.com E-mail: info@2x.com Information in this document is subject to change without notice. Companies, names, and data used in examples

Getting Started with Android Development By Steven Castellucci (v1.1, January 2015) You don't always need to be in the PRISM lab to work on your 4443 assignments. Working on your own computer is convenient

1) SETUP ANDROID STUDIO This process takes approximately 15-20 Minutes dependent upon internet speed and computer power. We will only be covering the install on Windows. System Requirements Android Studio

CHAPTER 8 Packaging and Deploying Java Projects in Forte This chapter introduces to use Forte s Archive wizard to package project files for deployment. You will also learn how to create shortcut for applications

Getting Started using the SQuirreL SQL Client The SQuirreL SQL Client is a graphical program written in the Java programming language that will allow you to view the structure of a JDBC-compliant database,

Part 1 Java Language Tools This beginning, ground-level part presents reference information for setting up the Java development environment and for compiling and running Java programs. This includes downloading

This guide is provided to Elluminate Live! users to assist them to make a successful connection to an Elluminate Live! session through a proxy firewall. In some cases settings discussed in this document

Printer Sharing of the PT-9500pc in a Windows Environment This procedure is for configuring the PT-9500pc as a shared printer in Microsoft Windows. For printer sharing to operate correctly, please be sure

CA Spectrum and CA Service Desk Integration Guide CA Spectrum 9.4 / CA Service Desk r12 and later This Documentation, which includes embedded help systems and electronically distributed materials, (hereinafter

Configure Java environment on Windows After installing Java Development Kit on Windows, you may still need to do some configuration to get Java ready for compiling and executing Java programs. The following

DEVELOPING CONTRACT - DRIVEN WEB SERVICES USING JDEVELOPER Purpose: The purpose of this tutorial is to develop a java web service using a top-down approach. Topics: This tutorial covers the following topics:

This guide is provided to Elluminate Live! users to assist them to make a successful connection to an Elluminate Live! session through a proxy firewall. In some cases settings discussed in this document

Signiant Agent installation Release 11.3.0 March 2015 ABSTRACT Guidelines to install the Signiant Agent software for the WCPApp. The following instructions are adapted from the Signiant original documentation

Download and Installation Instructions for Android SDK and Android Development Tools (ADT) on Microsoft Windows Updated September, 2013 This document will describe how to download and install the Android

Universal Management Service 2015 UMS 2015 Help All rights reserved. No parts of this work may be reproduced in any form or by any means - graphic, electronic, or mechanical, including photocopying, recording,

Installing the Android SDK To get started with development, we first need to set up and configure our PCs for working with Java, and the Android SDK. We ll be installing and configuring four packages today

DocAve Upgrade Guide From Version 4.1 to 4.5 About This Guide This guide is intended for those who wish to update their current version of DocAve 4.1 to the latest DocAve 4.5. It is divided into two sections:

User s Manual Third Edition, March 2011 www.moxa.com/product 2011 Moxa Inc. All rights reserved. User s Manual The software described in this manual is furnished under a license agreement and may be used

Notepad++ The COMPSCI 101 Text Editor for Windows The text editor that we will be using in the Computer Science labs for creating our Java programs is called Notepad++ and is http://notepad- plus.sourceforge.net

In a network environment, in order for the clients to access the data over the network, you will need to set up a network share to the data file. CREATING A NETWORK SHARE There may be slight differences

Test Your System Streaming Media System Requirements and Troubleshooting Assistance Test your system to determine if you can receive streaming media. This may help identify why you are having problems,

Creating Web Services Applications with IntelliJ IDEA In this tutorial you will: 1. 2. 3. 4. Create IntelliJ IDEA projects for both client and server-side Web Service parts Learn how to tie them together

1 of 10 15/02/2010 17:41 Creating a Java application using Perfect Developer and the Java Development Kit Introduction Perfect Developer has the facility to execute pre- and post-build steps whenever the

For Linux distributions Software version 4.1.7 Version 2.0 Disclaimer This document is compiled with the greatest possible care. However, errors might have been introduced caused by human mistakes or by

HPE Vertica QuickStart for IBM Cognos Business Intelligence HPE Vertica Analytic Database November, 2015 Legal Notices Warranty The only warranties for HPE products and services are set forth in the express

QUANTIFY INSTALLATION GUIDE Thank you for putting your trust in Avontus! This guide reviews the process of installing Quantify software. For Quantify system requirement information, please refer to the

DocuPrint C3290 FS Features Setup Guide Adobe and PostScript are trademarks of Adobe Systems Incorporated in the United States and/or other countries. Apple, Bonjour, ColorSync, EtherTalk, Macintosh, and

Setting up Hyper-V for 2X VirtualDesktopServer Manual URL: www.2x.com E-mail: info@2x.com Information in this document is subject to change without notice. Companies, names, and data used in examples herein

AzMERIT Secure Browser Installation Manual For Technology Coordinators 2014-2015 Revised January 5, 2015 Prepared by the American Institutes for Research Descriptions of the operation of the Test Information

Introduction To WebLogic Server Property of Web 10.3 Age Solutions Inc. Objectives At the end of this chapter, participants should be able to: Understand basic WebLogic Server architecture Understand the

Deploying the Parallels Containers Update Server in a Local Network Deploying the Parallels Containers Update Server in a Local Network 1999-2008 Parallels Holdings Ltd. All rights reserved. Distribution

For Linux distributions Software version 4.1.7 Version 2.0 Disclaimer This document is compiled with the greatest possible care. However, errors might have been introduced caused by human mistakes or by

JobScheduler - Job Execution and Scheduling System JobScheduler Installation by Copying Deployment of multiple JobSchedulers on distributed servers by copying a template JobScheduler March 2015 March 2015

Quick Start Guide DocuSign Retrieve 3.2.2 Published April 2015 Overview DocuSign Retrieve is a windows-based tool that "retrieves" envelopes, documents, and data from DocuSign for use in external systems.

Secure Browser Installation Manual 2015 2016 Published August 17, 2015 Prepared by the American Institutes for Research Table of Contents Section I. Introduction to the Secure Browser Manual... 1 Scope...

ilaw Installation Procedure This guide will provide a reference for a full installation of ilaw Case Management Software. Contents ilaw Overview How ilaw works Installing ilaw Server on a PC Installing