Nasa Worldwind SDK has some examples that I wish to run. There are two ways I am trying to run the examples provided in the SDK:
- Create an Eclipse project using the entire SDK source folder.
- point to all the worldwind dependencies (*.jar and *.dll files)
- Go to the folder with examples: src\gov\nasa\worldwind\examples.
- Run the example ApplicationTemplate.java main.
- Create an Eclipse project that is empty.
- point to all the worldwind dependencies (*.jar and *.dll files)
- point to worldwind.jar
- Then copy the examples folder into my Eclipse project.
- Refactor all the packages that are listed as gov.nasa.worldwind.examples to examples.
- Run the example ApplicationTemplate.java main.
When I do option (1.) I successfully compile/run with no errors.
When I do option (2.) I successfully compile but get run time errors:
Apr 13, 2011 12:18:35 PM gov.nasa.worldwind.WorldWind createComponent
SEVERE: Exception while creating World Wind component gov.nasa.worldwind.cache.BasicDataFileStore
Apr 13, 2011 12:18:35 PM gov.nasa.worldwind.WorldWind createConfigurationComponent
SEVERE: Unable to create class for configuration key gov.nasa.worldwind.cache.BasicDataFileStore
Exception in thread "main" java.lang.ExceptionInInitializerError
at gov.nasa.worldwind.awt.WorldWindowGLCanvas.<init>(Unknown Source)
at Main2.main(Main2.java:15)
Caused by: java.lang.IllegalStateException: Unable to create class for configuration key gov.nasa.worldwind.cache.BasicDataFileStore
at gov.nasa.worldwind.WorldWind.createConfigurationComponent(Unknown Source)
at gov.nasa.worldwind.WorldWind.initialize(Unknown Source)
at gov.nasa.worldwind.WorldWind.<init>(Unknown Source)
at gov.nasa.worldwind.WorldWind.<clinit>(Unknown Source)
... 2 more
Caused by: gov.nasa.worldwind.exception.WWRuntimeException: Exception while creating World Wind component gov.nasa.worldwind.cache.BasicDataFileStore
at gov.nasa.worldwind.WorldWind.createComponent(Unknown Source)
... 6 more
Caused by: java.lang.NullPointerException
at gov.nasa.worldwind.cache.BasicDataFileStore.<init>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
... 7 more
Due to licensing and configuration management issues, I would STRONGLY PREFER to go with Option (2.). Does anyone know how to fix these run time errors seen above?
Ok..These are my Eclipse project steps under Windows environment:
src
folder)lib
folder under this project (under the root of the project folder)lib
folder:gluegen-rt.jar, jogl.jar, worldwind.jar, jogl.dll, gluegen-rt.dll, jogl_awt.dll, jogl_cg.dll
HelloWorlWind.java
into thesrc
folderlib
folder into theReferenced Libraries
tree by right-clicking on each jar and selectBuild Path > Add to Build Path
jogl.jar
in theReferenced Libraries
tree and selectBuild Path > Configure Build Path
. It will pop upProperties
dialog boxProperties
dialog box, go toLibraries tab
and expandjogl.jar
treeNative library location
and clickEdit
button on the right. It will popupNative Library Folder Configuration
dialog box.lib
folder as the location path by clicking onWorkspace...
button.Then, run
HelloWorlWind.java
. It will display the glorious Worldwind Earth without any exception!Take note: a few Worldwind example apps don't terminate the JVM after you close the GUI window.
For the
ApplicationTemplate.java
to work, make sure to copy the required dependencies: