David Loucks - 2012-09-06

World Box Driving

The World Box Driving project is being developed with the Eclipse IDE for Java Developers
http://www.eclipse.org/downloads/packages/eclipse-ide-java-developers/junorc3

The WorldBoxDriving project depends upon the World Wind Java SDK and JBox2D.

The World Wind Java SDK can be download from this webpage
http://worldwind.arc.nasa.gov/java/index.html

JBox2D can be downloaded from this webpage
http://code.google.com/p/jbox2d/

The project is currently using World Wind Java SDK verion 1.4.0 and JBox2D version 2.1.2.2, later versions of each should also work properly.

Preparing files/directories

The following explanations use the directory D:\coding\ for simplicity.

Unzip World Wind Java SDK to
D:\coding\worldwind-1.4.0

Unzip JBox2D to
D:\coding\jbox2d-2.1.2.2

Unzip WBD to
D:\coding\WBD

Creating WBD project in Eclipse

Start Eclipse Juno, use the default workspace or create a new workspace (eg. D:\coding\WBD Workspace).

File->New->Java Project

Uncheck 'Use default location'.
Set 'Project name' to
WorldBoxDriving
Set 'Location' to
D:\coding\WBD
Click the 'Finish' button.

The project is created, although little red Xs are all over the place, dealing with them is the next step.

Project->Properties

Select 'Java Build Path'.
Select the 'Libraries' tab.
Click the 'Add External JARs...' button.

Browse to the directory
D:\coding\jbox2d-2.1.2.2\jbox2d-library\target
Select the file
jbox2d-library-2.1.2.2-jar-with-dependencies.jar
Click the 'Open' button.

Click the 'Add External JARs...' button.

Browse to the directory
D:\coding\worldwind-1.4.0
Select the files
gluegen-rt.jar
jogl.jar
worldwind.jar
gdal.jar
Click the 'Open' button.

Expand the entry for
jbox2d-library-2.1.2.2-jar-with-dependencies.jar
Select 'Source attachment' and click the 'Edit' button.
Select 'External location' and click the 'External File...' button.
Browse to the directory
D:\coding\jbox2d-2.1.2.2\jbox2d-library\target
Select the file
jbox2d-library-2.1.2.2-sources.jar
Click the 'Open' button.
Click 'OK' (in the 'Source Attachment Configuration' window).

Expand the entry for
worldwind.jar
Select 'Source attachment', click the 'Edit' button.
Select 'External location' and set 'Path' to
D:/coding/worldwind-1.4.0/src
Click the 'OK' button.

Expand the entry for
gdal.jar
Select 'Native library location' and click the 'Edit' button.
Set 'Location path' to
D:\coding\worldwind-1.4.0

Expand the entry for
gluegen-rt.jar
Select 'Native library location' and click the 'Edit' button.
Set 'Location path' to
D:\coding\worldwind-1.4.0

Expand the entry for
jogl.jar
Select 'Native library location' and click the 'Edit' button.
Set 'Location path' to
D:\coding\worldwind-1.4.0

Click the 'OK' button (in the Properties for WorldBoxDriving window).
All the red Xs in the WorldBoxDriving project should be gone.

Compiling/running WBD

In the WorldBoxDriving project, expand the 'src' folder and then the 'worldboxdriving.director' folder, open the DirectorTestMain.java file.
Run->Run

Problem

The program won't run and this error shows in the console:
Exception in thread "main" java.lang.UnsatisfiedLinkError: D:\coding\worldwind-1.4.0\jogl.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform

Solution

The default Native Libraries in World Wind Java SDK are for the Intel platform, replace them with AMD Native Libraries, also packaged with the World Wind Java SDK:

Change the extension from .jar to .zip on the file
D:\coding\worldwind-1.4.0\gluegen-rt-natives-windows-amd64.jar
Open the .zip file and extract the file
gluegen-rt.dll
To the directory
D:\coding\worldwind-1.4.0

Change the extension from .jar to .zip on the file
D:\coding\worldwind-1.4.0\jogl-natives-windows-amd64.jar
Open the .zip file and extract the files
jogl.dll
jogl_awt.dll
jogl_cg.dll
To the directory
D:\coding\worldwind-1.4.0

 

Last edit: David Loucks 2012-09-07