NetBeans Platform Runtime Container Tutorial
This tutorial covers the most fundamental concept in the NetBeans Platform—the runtime
container. The runtime container is the execution environment for the modules that define
a NetBeans Platform application. It consists of 5 modules provided by the NetBeans Platform.
In this tutorial, we will look at these 5 modules, and use them in a very simple modular
application.
Before going further, you can watch this video, which covers the same material as the
rest of this tutorial:
Contents
To follow this tutorial, you need the software and resources listed in the following table.
Introduction to the Runtime Container
The "NetBeans runtime container" is the collective name for these 5
NetBeans Platform modules:

Brief overview of each of these 5 modules:
- Bootstrap—Enables the runtime container to understand what
a module is and how to load and compose them into one application.
- Startup—Provides the main method of your application, as well
as all the code needed for starting it up.
- Filesystem API—Gives your application a filesystem.
- Module System API—Lets you influence the lifecycle of
the modules in your application.
- Utilities API—Includes many utility classes, especially
the Lookup class, which is used for communication between modules.
Setting up the Runtime Container
In this section, we will create an absolutely minimal NetBeans Platform application.
It will consist of only those modules that every NetBeans Platform application must
have—the 5 modules that make up the runtime container. Once we have create
an application that consists of nothing more than these 5 modules, we will run it.
There will be no specific output from this application. However, it will build and
run successfully because all the fundamental requirements of a NetBeans Platform
application will have been met.
Go to File > New Project. In the New Project dialog, choose
NetBeans Modules > NetBeans Platform Application:

Click Next.
- Name your application 'Hello World'. Click Finish.
- Right-click the main project node in the Projects window,
choose Properties, and go to the Libraries tab. There you can
see all the modules that are part of this application.
- In addition to the runtime container, many other modules are
included. Exclude them now. Make sure that ONLY the 5 modules that make
up the runtime container are included.
Run the application and notice that the application successfully
executes.
Loading a New Module into the Runtime Container
In this section, we add one new module to the NetBeans runtime container. The new
module will do nothing special. The only reason for adding it will be so that you
can see that it will be an equal partner to the other modules in your application.
You will have six modules instead of 5: in addition to the 5 modules that you
already have, you will also have your custom module.
Next, we will influence the module's lifecycle. When it is loaded into the
runtime container, we will use one of the module's lifecycle methods to send
a 'Hello World' message to the Output window.
- Right-click the application's Modules node and choose 'Add New...'.
Click Next.
- Give your module a project name and a code name base.
Click Finish. You now have a new module.
- Right-click the module, choose New > Other, and then choose
Module Development > Module Installer.
Click Next and then complete the wizard. You now have a new
class that extends 'ModuleInstaller', which is from the Module
System API.
- Add a new 'System.out.println' message in the 'restored' method of
the Installer class.
Run the application again and notice the 'Hello World' message in the Output window.
Next Steps
For the next steps in the "NetBeans Platform Fundamentals"
series, see: