My operating platform Windows 7 64-bit operating system, if 32-bit, then in the copy of some jar packets to pay attention to 32-bit.
First download the latest Wordwind source file on the website (i downloaded the 2.0 version), unzip it, and then create a new Java Project in Eclipse.
If you want to research the WorldWind source code, the development environment is built as follows :
1. Copy all the directory files under the SRC folder in the downloaded file to the SRC directory in the project.
2. Create a new Lib folder in Java Engineering to Gadl.jar, Gluegen-rt.jar, Gluegen-rt-natives-windows-amd64.jar, Jogl-all.jar, Jogl-all-natives-windows-amd64.jar, Plugin.jar Copy to the liturgical directory.
3. In the project, on the JRE System Library, right-click on build Path→configure build Path, click Add JARs under the Libraries tab, and then add all the jar packages under the Lib folder, as shown below.
Done, run any Java files under the Gov.nasa.worldwindx.examples package, and the results are as follows:
If you only want to use WorldWind for two development, the development environment only needs to be configured like this :
1. Create a new Lib folder in Java Engineering to Worldwin.jar, Worldwindx.jar, Gluegen-rt.jar, Gluegen-rt-natives-windows-amd64.jar, Jogl-all.jar, Jogl-all-natives-windows-amd64.jar copy to Lib directory.
2. In the project, on the JRE System Library, right-click on build Path→configure build Path, click Add JARs under the Libraries tab, and then worldwin.jar the Lib folder, Worldwindx.jar, Gluegen-rt.jar, Jogl-all.jar added, as shown below.
3. Add your own code to the SRC source file directory and invoke the API provided by WorldWind.
An example is given below:
Import Java.awt.BorderLayout;
Import java.awt.Dimension;
Import Java.awt.EventQueue;
Import Java.awt.Toolkit;
Import Javax.swing.JFrame;
Import Gov.nasa.worldwind.BasicModel;
Import Gov.nasa.worldwind.awt.WorldWindowGLCanvas; public class Helloworldwind {public static class Worldwindframe extends JFrame {private static final long serialve
Rsionuid = -130932605398355602l;
Private Worldwindowglcanvas Windowcanvas;
Public Worldwindframe () {Windowcanvas = new Worldwindowglcanvas ();
Dimension framesize = new Dimension (600,600);
Windowcanvas.setpreferredsize (framesize);
This.settitle ("Worldwinddemo");
This.getcontentpane (). Add (Windowcanvas,borderlayout.center);
Dimension screensize = Toolkit.getdefaulttoolkit (). Getscreensize ();
This.setlocation ((screensize.width-framesize.width)/2, (Screensize.height-framesize.height)/2);
This.pack ();
Windowcanvas.setmodel (New Basicmodel ()); }} public static void Main (string[] args) {eventqueue.iNvokelater (New Runnable () {@Override public void run () {new Worldwindframe (). setvisible (True);
}
}); }
}
The results of the operation are as follows: