|Read more about this book|
(For more resources on NetBeans, see here.)
In addition to being an IDE, NetBeans is also a platform. Developers can use NetBeans’ APIs to create both NetBeans plugins and standalone applications.
For a brief history of Netbeans, see http://netbeans.org/about/history.html.
Although the NetBeans IDE supports several programming languages, because of its roots as a Java only IDE it is a lot more popular with this language. As a Java IDE, NetBeans has built-in support for Java SE (Standard Edition) applications, which typically run in the user’s desktop or notebook computer; Java ME (Micro Edition), which typically runs in small devices such as cell phones or PDAs; and for Java EE (Enterprise Edition) applications, which typically run on “big iron” servers and can support thousands of concurrent users.
NetBeans can be obtained by downloading it from http://www.netbeans.org.
To download NetBeans, we need to click on the button labeled Download Free NetBeans IDE 7.0 (the exact name of the button may vary depending on the current version of NetBeans). Clicking on this button will take us to a page displaying all of NetBeans download bundles.
NetBeans download includes different NetBeans bundles that provide different levels of functionality. The following table summarizes the different available NetBeans bundles and describes the functionality they provide:
|Java SE||Allows development of Java desktop applications.|
|Java EE||Allows development of Java Standard Edition (typically desktop applications), and Java Enterprise Edition (enterprise application running on “big iron” servers) applications.|
|C/C++||Allows development of applications written in the C or C++ languages.|
|PHP||Allows development of web applications using the popular open source PHP programming language.|
|All||Includes functionality of all NetBeans bundles.|
To follow the examples, either the Java EE or the All bundle is needed.
The screenshots were taken with the Java EE bundle. NetBeans may look slightly different if the All Pack is used, particularly, some additional menu items may be seen.
The following platforms are officially supported:
- Windows 7/Vista/XP/2000
- Linux x86
- Linux x64
- Solaris x86
- Solaris x64
- Mac OS X
Additionally, NetBeans can be executed in any platform containing Java 6 or newer. To download a version of NetBeans to be executed in one of these platforms, an OS independent version of NetBeans is available for download.
Although the OS independent version of NetBeans can be executed in all of the supported platforms, it is recommended to obtain the platform-specific version of NetBeans for your platform.
The NetBeans download page should detect the operating system being used to access it, and the appropriate platform should be selected by default. If this is not the case, or if you are downloading NetBeans with the intention of installing it in another workstation on another platform, the correct platform can be selected from the drop down labeled, appropriately enough, Platform.
Once the correct platform has been selected, we need to click on the appropriate Download button for the NetBeans bundle we wish to install. For Java EE development, we need either the Java EE or the All bundle. NetBeans will then be downloaded to a directory of our choice.
Java EE applications need to be deployed to an application server. Several application servers exist in the market, both the Java EE and the All NetBeans bundles come with GlassFish and Tomcat bundled. Tomcat is a popular open source servlet container, it can be used to deploy applications using the Servlets, JSP and JSF, however it does not support other Java EE technologies such as EJBs or JPA. GlassFish is a 100 percent Java EE-compliant application server. We will be using the bundled GlassFish application server to deploy and execute our examples.
NetBeans requires a Java Development Kit (JDK) version 6.0 or newer to be available before it can be installed.
NetBeans installation varies slightly between the supported platforms. In the following few sections we explain how to install NetBeans on each supported platform.
For Microsoft Windows platforms, NetBeans is downloaded as an executable file named something like netbeans-7.0-ml-java-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-7.0-ml-javamacosx.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.
The Mac OS X installer contains four packages, NetBeans, GlassFish, Tomcat, and OpenESB, these four packages need to be installed individually, They can be installed by simply double-clicking on each one of them. Please note that GlassFish must be installed before OpenESB.
Linux and Solaris
For Linux and Solaris, NetBeans is downloaded in the form of a shell script. The name of the file will be similar to netbeans-7.0-ml-java-linux.sh, netbeans-7.0-mljava-solaris-x86.sh, or netbeans-7.0-ml-java-solaris-sparc.sh, depending on the version of NetBeans, the selected platform and the selected NetBeans bundle.
Before NetBeans can be installed in these platforms, the downloaded file needs to be made executable. This can be done in the 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 with the appropriate file name for the platform and the NetBeans bundle.
Once the file is executable it can be installed from the command line:
Again substitute filename.sh with the appropriate file name for the platform and the NetBeans bundle.
For other platforms, NetBeans can be downloaded as a platform-independent zip file. The name of the zip file will be something like netbeans-7.0-201007282301-mljava.zip (exact file name 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.