Skip to main content

Running With the Netbeans Platform

This is the second of two posts documenting the creation of a Netbeans module, and running it stand-alone on the Netbeans Platform. The first post was Newbee NetBean Module Creation. It's been over a month since that first post, and a lot longer than I intended. Unfortunately life intruded. I'm now on vacation (working around the house on my infinitely long honey-do list) and making the odd post. I've now caught up somewhat and I can relax and look at my other lists of things to do, such as this series.

The Netbeans Platform is the equivalent of the Eclipse Projects Rich Client Platform (or RCP SDK). The significant difference between the Netbeans Platform and the RCP is that the Netbeans Platform will run out-of-the-box (although it is very dull at that point) while the RCP must be combined with a Eclipse plugin and configured to run as a complete application (although this is not hard to do). The Netbeans Platform appears at first blush to be easier to work with.

You need to get the Netbeans Platform. When you go to the download page, make sure to select release 4.1, that you select the release version, and then select the platform you're running on (Windows, Linux, etc). For this example I'm running on Windows, so I'll install netbeans-4_1-platfirm.zip. And as before, it will be installed in my Java work area, C:\Java. In addition, I have created an empty work user directory, C:\Java\nb_test.
  1. To install the Anagrams plug-in/module into the NetBeans Platform, you need to run the platform. Go to the directory where the NetBeans Platform distribution was extracted.
    Change directory into netbeans\platform5\lib (in my case, C:\Java\netbeans\platform5\lib). In this directory is a Windows binary called nbexec. So that you don't collide with the NetBeans settings in your .netbeans directory, you should pass the --userdir [test_dir] arg to nbexec. For instance, to set the C:\Java\nb_test as the userdir for the NetBeans Platform (as well as to just test the platform), you would execute:
    C:> nbexec --userdir C:\Java\nb_test
  2. To illustrate how lightweight the NetBeans Platform is, select the File > View Toolbars and select the checkbox next to Memory. You will now see a Java heap memory usage meter in the NetBeans Platform toolbar. The NetBeans Platform is only using a small amount of Java heap. In this example, it's about 7 meg.

  3. To add the Anagram plug-in / module, select the Tools > Update Center menu item. Click the radio button "Install Manually Downloaded Modules (.nbm Files) and press the Next button.

  4. Click on the Add button and traverse to the directory where you created your Anagram project back in Step 5 of the first post. In the Anagram project directory you will find the an anagrams.nbm file. Select this file and press Ok. Click the Next button. Click the Next button again. The NetBeans Platform will install the anagrams plug-in / module very quickly. Press the Next button again. Check the box next in the "Include" column. The NetBeans Platform will tell you this module is an unsigned plug-in/module and ask if you want to install it anyway. Say, "Yes" to proceed with the installation. Then, press the Finish button.

  5. You will now see a "Games" menu in the NetBeans Platform (see the image at step two above). Go ahead and click on the Games menu and select Anagrams.
One of the advantages of installing plug-ins / modules in the NetBeans IDE is that you can use the NetBeans tools such as the debugger to help debug the plug-in. One of the things you'll need to do in order to re-install the plug-in as you go through the code, compile, test, debug cycle is to remove the old plug-in and its metadata in NetBeans. Unfortunately, you have to do this manually.

If you are working with the NetBeans Platform and you want to remove the plug-in so you can re-install a different one, go to the directory you specified as the --userdir. Above we used C:\Java\nb_test. You will need to remove the following files:
C:\Java\nb_test\update_tracking\com-toys-anagrams.xml
C:\Java\nb_test\config\Modules\com-toys-anagrams.xml
C:\Java\nb_test\modules\anagrams.jar

If you are working with the NetBeans IDE and you want to remove the Anagrams plug-in after you have added it to the NetBeans IDE, go to the C:\Documents and Settings\[username]\.netbeans directory and remove the following files:
4.1\update_tracking\com-toys-anagrams.xml
4.1\config\Modules\com-toys-anagrams.xml
4.1\modules\anagrams.jar

After you have removed these files you will be able make changes to your plug-in / module, rebuild it and re-install it.

Comments

Popular posts from this blog

cat-in-a-box channels greta garbo

So I'm sitting at my computer, when I start to notice a racket in back. I ignore it for a while until I hear a load "thump!", as if something had been dropped on the floor, followed by a lot of loud rattling. I turn around and see Lucy in the box just having a grand old time, rolling around and rattling that box a good one. I grab the GX1 and snap a few shots before she notices me and the camera, then leaps out and back into her chair (which used to be my chair before she decided it was her chair).

Just like caring for Katie my black Lab taught me about dogs, caring for Lucy is teaching me about cats. She finds me fascinating, as I do her. And she expresses great affection and love toward me without coaxing. I try to return the affection and love, but she is a cat, and she takes a bat at me on occasion, although I think that's just her being playful. She always has her claws in when she does that.

She sits next to me during the evening in her chair while I sit in mi…

vm networking problem fixed

Over the weekend I upgraded to Windows 8.1, then discovered that networking for the virtual machines wouldn't work. Then I tried something incredibly simple and fixed the problem.

Checking the system I noticed that three VMware Windows services weren't running; VMnetDHCP, VMUSBArbService, and VMwareNatService. VMware Player allows you to install, remove, or fix an existing installation. I chose to try fixing the installation, and that fixed the problem. The services were re-installed/restarted, and the virtual machines had networking again.

Once network connectivity was established there was exactly one updated file for Ubuntu 13.10, a data file. This underscores how solid and finished the release was this time. Every other version of every other Linux installation I've ever dealt with has always been succeeded by boatloads of updates after the initial installation. But not this time.

Everything is working properly on my notebook. All's right with the world.

first night for the gingersnaps

The first night has passed and the two have managed to survive, in spite of what their tiny hearts might have thought when first arriving. Greebo, the larger of the two, has been in hiding the entire time so far. Ponder has spent the time zipping in and out of hiding spots, checking things out, and learning just how comfortable pillows are for resting your head.

During the night I felt the tiny body of Ponder hitting the bed as he leaped up on the side, and then climbed to the top to run around on top of me. At least once he play-attacked my fingers. He might be small but his claws are still quite sharp.

When I got up in the morning the bowl of cat kitten food was fairly well depleted. It's been refilled and fresh water put in the big dish on the floor. I'm assuming that both Greebo and Ponder are feeding and drinking. I have seen Greebo under the furniture peeking out at me when I went looking for him. I'm leaving him alone while he continues to adjust.

So far the guys h…