Netbeans IDE

From OpenIndivo Documentation Wiki

Jump to: navigation, search

Authors Steve Climans, Bsimons

September 14th 2006

This document provides a detailed description of the steps required to install and build the Indivo source code on a Microsoft Windows platform using an open source graphical integrated development environment. Intended as a gentle introduction, more experienced developers may need only skim portions of the document. Note that although this document has been written primarily for Microsoft Windows users, the concepts transfer easily to both Linux and Mac OS.

Contents

Introduction

Why a graphical development environment

A graphical integrated development environment (IDE) can be used to develop and build the Indivo source. A number of developers grow to prefer the feature set of an environment that allows for color coded syntax highlighting, code completion and integrated edit, build and deploy environments.

Of the many products available from both open source and commercial vendors, the choice of which IDE to use is often a personal one. For this HOWTO, the open source IDE NetBeans will be used. The choice of this tool was based on the feature set provided and the advanced support for seamlessly integrating the Maven2 build system used by Indivo.

This document will build upon the document [HOW-TO Create and Operate a Command Line Toolchain for Indivo Development under Microsoft Windows]. By first following the steps in that document to create a command line toolchain, the necessary foundation will be in place to add the NetBeans IDE.

Reporting errata

Email the users list. To send an email to the list, you must be subscribed. You can subscribe here.

Typographic conventions used in the document

To indicate code typed into the command line, a monospaced font will be used.

Notice and Disclaimers

  1. This document was accurate as at September 14th, 2006 when applied to the Indivo build ping-3.0-beta.
  2. Agreement and compliance with license terms of the various components mentioned in this HOWTO is at the sole discretion of the user.
  3. All trademarks are the property of their respective owners.

Document Objective

  • Install and verify the correct operation of the necessary software development tools
  • Download the latest source code from the public Indivo repository
  • Perform a successful build within the IDE of the Indivo source code on the local machine.

Intended Audience

  • Assumed Developer Proficiency
    • The intent of this document is to be inclusive and accessible to a wide range of developers. More experienced Java developers will likely skip segments of this document.
  • Platform Knowledge
    • Basic knowledge of the Windows operating system is assumed.
  • Tool Knowledge
    • Minimal knowledge of the Java, Maven and Subversion toolsets are assumed.
  • Preconditions
    • An installed and operational copy of Windows XP Professional.
    • A logged on user with local Administrator access
    • Internet access to download required software and source code

Steps to Construct the Graphical Integrated Development Environment

Ensure the Pre-requisites Exist

Verify the Java Development Kit has been installed

From the Windows Start button on the menu, select the Run menu item. Into the dialog box, enter the command cmd and press the Ok button. This will open a command window with a shell prompt

Opening a command window
Enlarge
Opening a command window

At the prompt, enter the command javac -version

The following result should be displayed:

Confirm Java compiler is accessible from the command prompt
Enlarge
Confirm Java compiler is accessible from the command prompt
Verify the Maven Build Environment has been installed

From within the open command window, enter the command: mvn -version You should see the response as indicated:

Confirm Maven build environment is accessible from the command prompt
Enlarge
Confirm Maven build environment is accessible from the command prompt

Install the NetBeans Integrated Development Environment

Download the NetBeans Version 5.5 Beta

The NetBeans IDE version 5.5, Beta 2 will be used. From within a browser of your choice, navigate to Netbeans.org and browse to the download section. Select the download of the NetBeans IDE 5.5 Beta 2 Installer and indicate your agreement to the required license terms if acceptable.

At the time of writing, the offline installation option download option is a file named netbeans-5_5-beta2-windows.exe

Install and Configure

As a user with Administrator privileges, run the downloaded executable, accepting all defaults in accordance with the license terms if acceptable. More detailed installation instructions are provided by NetBeans at Netbeans 5.5 Install Notes

Verify

From either the Windows Start menu or the desktop shortcut, launch the NetBeans program. The NetBeans IDE should be displayed.

The NetBeans IDE
Enlarge
The NetBeans IDE
Install the Maven Build Environment Plug-in
Download

Codehaus.org provides the Mevenide2-Netbeans plug-in under the Apache open source license, which integrates Maven2 support into the NetBeans IDE. Download the latest copy from Codehaus at: Meven IDE 2.2

Install and Configure

Detailed installation instructions are provided by Codehaus at Meven IDE instructions . Follow these steps to install the plug-in within NetBeans.

Verify

Once completed, you will be prompted to restart the NetBeans IDE to complete the installation. After the restart, open a new project using the NetBeans menu:

The NetBeans New Project Menu Selection
Enlarge
The NetBeans New Project Menu Selection

The Maven2 Category should appear in the list of the available project types:

The Maven2 Project Type
Enlarge
The Maven2 Project Type
Install the Subversion Repository Client Plug-in
Download

The NetBeans Beta 5.5 is the first release to provide native Subversion repository support, but this is not installed by default. To install this plug-in, select the Update Center option from the Tools menu:

The NetBeans Update Center
Enlarge
The NetBeans Update Center

A dialog window will prompt for the selection of the NetBeans 5.5 Beta Update Center checkbox. Select the checkbox and press the Next button:

Selecting the NetBeans Update Center
Enlarge
Selecting the NetBeans Update Center

The next dialog window will present all the updates available for installation into the NetBeans IDE. Select the Subversion feature and press the Add button.

Selecting the Subversion feature
Enlarge
Selecting the Subversion feature

This will include the needed components. Press the Next button.

Installing Subversion
Enlarge
Installing Subversion

NetBeans will prompt for acceptance of the license terms of the components, and if accepted, will proceed to download the needed code. When complete, press the Next button.

Subversion component download complete
Enlarge
Subversion component download complete

The last step is to accept the certificates attached to the code. Ensure these are checked and press the Finish button:

Acceptance of component certificates
Enlarge
Acceptance of component certificates
Install and Configure

The installation and configuration were completed in the steps outlined above.

Verify

Once installation is complete, the Subversion menu item will appear in the top line menu:

Subversion menu item within NetBeans
Enlarge
Subversion menu item within NetBeans

Download the Latest Indivo Source Code

To download the latest Indivo source code, select the Subversion Checkout menu item:

Subversion Checkout menu item
Enlarge
Subversion Checkout menu item

Enter the following as the repository URL:

https://cvs.chip.org/svn/repos/ping/tags/ping-3.0-beta/

Subversion repository URL
Enlarge
Subversion repository URL

The first time the repository is accessed, a window will display asking to confirm the repository server certificate. In this case, select the button to Accept permanently.

Accepting the Indivo Subversion server certificate
Enlarge
Accepting the Indivo Subversion server certificate

The next screen will display the dialog to select the version and the location of the checked out files. When complete, press the Finish button.

Location of checked out files
Enlarge
Location of checked out files

At this point, the checkout will commence and may take some time given the size of the Indivo repository. Once complete, the dialog will confirm the number of projects download and prompt to open a project, select Open project

Confirmation of downloaded projects from the repository
Enlarge
Confirmation of downloaded projects from the repository

The next dialog requests to open the project folder. Highlight the ping-beta-3.0 and press the Open Project Folder button.

Open the Selected Project
Enlarge
Open the Selected Project

Within the project tab of the NetBeans workspace, the Ping project appears, properly identified as a Maven2 project. The POM (Project Object Model) is the master Maven build configuration. For more information on the POM, see the following article:

POM

Indivo Project properties within the IDE Project Tab
Enlarge
Indivo Project properties within the IDE Project Tab

Maven is based upon the central concept of a build lifecycle with a number of predefined targets. These targets will be predictable across any Maven build configuration.

The validate target will ensure the project is correct and all necessary information is available. For further information on the available Maven targets, see the following link:

Introduction to the Lifecycle

The Maven validate target
Enlarge
The Maven validate target

Selecting the validate target will display the following dialog box. Accept the defaults presented.

Maven target options dialog for validate
Enlarge
Maven target options dialog for validate

Upon a successful validation, the Output window of the IDE will appear as follows:

Project validation successful
Enlarge
Project validation successful

At this point, repeat the above steps to perform a Maven compile.

Select the Maven compile target
Enlarge
Select the Maven compile target
Maven target options dialog for compile
Enlarge
Maven target options dialog for compile

During the compile, there may be missing dependencies that have been specified in the POM but are not available locally. In this case, there will be a delay while the missing resource is downloaded automatically.

Upon a successful compile, the Output window of the IDE will appear as follows:

Project compile successful
Enlarge
Project compile successful

If this screen shows anything other than BUILD SUCCESSFUL, please post a message to the Indivo forums to resolve the error.

Glossary of Terms

  • IDE - Integrated Development Environment, often a graphic environment used to edit and build source code.
  • JDK - The Java Development Kit provided by Sun Microsystems used to compile Java programs.
  • JRE - The Java Runtime Environment provided by Sun Microsystems used to run already compiled Java programs. For the purposes of building Indivo from source code, the JRE alone is not sufficient.
  • Toolchain - A toolchain is a series of programs that work in conjunction to accomplish the building of the Indivo source into an application.
Personal tools