Book Image

Java EE 7 Development with NetBeans 8

By : David R Heffelfinger
5 (1)
Book Image

Java EE 7 Development with NetBeans 8

5 (1)
By: David R Heffelfinger

Overview of this book

Table of Contents (18 chapters)
Java EE 7 Development with NetBeans 8
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Installing NetBeans


NetBeans requires a Java Development Kit (JDK) Version 1.7 or newer to be available before it can be installed.

Note

Since this book is aimed at experienced Java developers, we will not spend much time explaining how to install and configure the JDK. We can safely assume that the target market for the book is more than likely to have a JDK installed. Installation instructions for the Java Development Kit can be found at http://docs.oracle.com/javase/7/docs/webnotes/install/index.html.

NetBeans installation varies slightly between the supported platforms. In the following few sections we explain how to install NetBeans on each supported platform.

Microsoft Windows

For Microsoft Windows platforms, NetBeans is downloaded as an executable file named something like netbeans-8.0-javaee-windows.exe (exact name depends on the version of NetBeans and the NetBeans bundle that was selected for download). To install NetBeans on Windows platforms, simply navigate to the folder where NetBeans was downloaded and double-click on the executable file.

Mac OS X

For Mac OS X, the downloaded file is called something like netbeans-8.0-javaee-macosx.dmg (exact name depends on the NetBeans version and the NetBeans bundle that was selected for download). In order to install NetBeans, navigate to the location where the file was downloaded and double-click on it.

Linux

For Linux, NetBeans is downloaded in the form of a shell script. The name of the file will be similar to netbeans-8.0-javaee-linux.sh (exact name will depend on the version of NetBeans and the selected NetBeans bundle).

Before NetBeans can be installed on Linux, the downloaded file needs to be made executable, which can be done using a command line—by navigating to the directory where the NetBeans installer was downloaded and executing the following command:

chmod +x filename.sh

Substitute filename.sh in the preceding command with the appropriate filename for the platform and NetBeans bundle. Once the file is executable it can be installed from the command line as follows:

./filename.sh

Other platforms

For other platforms, NetBeans can be downloaded as a platform independent ZIP file. The name of the ZIP file will be something like netbeans-8.0-201403101706-javaee.zip (exact filename may vary, depending on the exact version of NetBeans downloaded and the NetBeans bundle that was selected).

To install NetBeans on one of these platforms, simply extract the ZIP file to any suitable directory.

Installation procedure

Even though the way to execute the installer varies slightly between platforms, the installer behaves in a similar way between most of them.

Note

One exception is the platform independent ZIP file, in which there is essentially no installer. Installing this version of NetBeans consists of extracting the ZIP file to any suitable directory.

After executing the NetBeans installation file for our platform, we should see a window similar to the one illustrated in the following screenshot.

The pack shown may vary depending on the NetBeans bundle that was downloaded. The preceding screenshot is for the Java EE bundle.

At this point, we should click on the button labeled Next> to continue the installation.

NetBeans is dual licensed, licenses for NetBeans include the GNU Public License (GPL) Version 2 with the classpath exception, and the Common Development and Distribution License (CDDL). Both of these licenses are approved by the Open Source Initiative (OSI).

To continue installing NetBeans, click on the checkbox labeled I accept the terms in the license agreement and click on the button labeled Next>.

NetBeans comes bundled with JUnit, a popular Java unit testing framework. JUnit's license differs from the NetBeans license, so it needs to be accepted separately. Clicking the Next> button takes us to the next step in the installation wizard:

At this point the installer will prompt us for a NetBeans installation directory, and for a JDK to use with NetBeans. We can either select new values for these or retain the provided defaults.

Once we have selected the appropriate installation directory and JDK, we need to click on the button labeled Next> to continue the installation.

Note

NetBeans uses the JAVA_HOME environment variable to populate the JDK's directory location.

The installer will now prompt us for an installation directory for the GlassFish application server, as well as for the JDK to use for GlassFish; we can either enter a custom directory or accept the default values and then click on Next>.

If we chose to install Tomcat, the installer will prompt us for a Tomcat installation directory. Again, we can either enter a custom directory or accept the default values and then click on Next>.

At this point, the installer will display a summary of our choices. After reviewing the summary, we need to click on the button labeled Install to begin the installation.

As the installation begins, the installer starts displaying a progress bar indicating the progress of installation.

After NetBeans and all related components have been installed, the installer indicates a successful installation, giving us the option to contribute anonymous usage data as shown in the preceding screenshot. After making our selection we can simply click on the Finish button to exit the installer.

On most platforms, the installer places a NetBeans icon on the desktop; the icon should look like the following:

We can start NetBeans by double-clicking on the icon.