WWJava in NetBeans IDE

From World Wind Wiki

Jump to: navigation, search

Contents

[edit] (0.6 SDK era) Tracking WWJava SDK versions from NetBeans

Chiss’ instructions (0.5 SDK era, see below) for initial NetBeans build remain an excellent help for building a 0.6 WWJava SDK using NetBeans 6.9.1 and 32-bit version of the JDK 1.6.0_22 on a Windows 7 64-bit machine. If you’re building the WWJava SDK for the first time, follow those instructions and add ‘gdal.jar’ at the same time you’re adding ‘gluegen-rt.jar’ and ‘jogl.jar’ via the ‘Add JAR/Folder’ button.

The WWJava team doesn’t publish a CM repository as of December 2010. It uses Subversion (SVN) internally. There’s plenty of discussion on this subject in the forums if you’re interested. If you’d like to effectively track WWJava builds releases externally using Mercurial, keep reading this section. These instructions assume you’re familiar with Mercurial, its integration with NetBeans, and that you’ve already committed an initial version of the WWJava SDK to a Mercurial repository inside NetBeans:

[edit] (0.5 SDK era) Compiling and running the SDK examples

This step by step guide was created with NetBeans 6.x and the 0.5.0 release of the SDK. However, the general principals outlined here should work regardless of the SDK version.

You can now run any of the examples by right-clicking them and selecting ‘Run File’ from the contextual menu.

[edit] (0.1 SDK era) Original entry from Geertjan’s log when the 0.1 SDK was initially released

Now that the worldwind.jar for NASA World Wind is available, here’s the absolutely simplest scenario that you can implement very quickly and efficiently with NetBeans IDE:

-Djava.library.path=/path/to/unzipped/nasa/download

Image:nasa1.png

public class WWHelper { 
   private WWHelper() {
   }
   public static void setup(final WorldWindow ww) {
       Model m = (Model) WorldWind.createConfigurationComponent(AVKey.MODEL_CLASS_NAME);
       ww.setModel(m);
   }
}
WWHelper.setup(worldWindowGLCanvas1);

Image:nasa2.png

Image:nasa3.png

This is the start of a series of blog entries on this topic. And a NetBeans tutorial will follow, as well as related NetBeans modules, such as templates and so on. With thanks to Ken Russell for help and support.

Source: Geertjan’s Weblog