FeaturesPluginsDocs & SupportCommunityPartners

Working with the Open Sourced JConsole

One of the open sourced JDK NetBeans projects provides the JConsole. JConsole is a GUI monitoring tool that complies to the JMX specification. The JConsole API provides a programmatic interface to access JConsole. Both will be explored in this tutorial.

When encountering problems of any kind, please consult the Troubleshooting Guide.

Setting up

Download and install the OpenJDK sources, and then open the JConsole project, as explained in Getting Started with OpenJDK in NetBeans IDE.

Once you have opened the project, the Projects window should look as follows:

JConsole in projects window

Building the JConsole

To build the JConsole sources, right-click the JConsole project in the Projects window and choose Build Project. The IDE runs the Ant script for the project and shows output in the Output window.

To view the build results, go to the Favorites window (Ctrl-3) and browse to the "j2se" folder. Once you have added the folder, you can see the newly created "build" and "dist" folders, the latter containing your build output, as shown in the following image:

JConsole built

Running the JConsole

Once you have built the compiler, you can run it by right-clicking the JConsole project in the Projects window and choosing Run Project. The IDE runs the Ant script for the project and deploys the JConsole:

JConsole running

Generating JConsole Javadoc

When you want to access JConsole programmatically, you can do so via the JConsole API. Before you do so, you can generate the JConsole Javadoc. Right-click the JConsole project and choose Generate Javadoc for Project. The IDE's browser appears, displaying the generated Javadoc:

JConsole running

In the Favorites window (Ctrl-3), you can browse to the Javadoc files, which are generated to the j2se/build/${platform}/javadoc/jconsole folder, as shown below:

Javadoc sources

Companion
Projects:
MySQL Database Server   Open JDK: an Open SourceJDK   GlassFish Community: an Open Source Application Server    Mobile & Embedded Community    Open Solaris   java.net - The Source for Java Technology Collaboration   Virtual Box - full virtualizer  Open ESB - The Open Enterprise Service Bus Powered by