World wind Java SDK安裝開發測試

來源:互聯網
上載者:User

worldwind早前發布了開源的java版本的SDK。下載到後的安裝測試步驟如下:

1. 下載worldwind java sdk

   :http://builds.worldwind.arc.nasa.gov/download.asp

   解壓之後,可以獲得jogl.jar、gluegen-rt.jar、worldwind.jar、gluegen-rt.dll、jogl.dll、jogl_awt.dll、jogl_cg.dll

2. 開啟eclipse,建立java工程
    1)在工程下建立lib檔案夾,把第一步得到的3個jar包,放到lib目錄下
    2)在電腦上建立一個檔案夾將第一步得到的4個DLL檔案放進去
    3)右擊jogl.jar,Build Path--->Configure Build Path---->點擊jogl.jar包,找到Native library location->Edit,將2.2的檔案路徑放到location path中,見圖片。

3. 建立java檔案
package cn.worldwind.test;

import gov.nasa.worldwind.BasicModel;
import gov.nasa.worldwind.awt.WorldWindowGLCanvas;

public class Helloworld {

 public static class AppFrame extends javax.swing.JFrame {

  /**
         *
         */
        private static final long serialVersionUID = 1L;

  public AppFrame() {
   WorldWindowGLCanvas wwd = new WorldWindowGLCanvas();
   wwd.setPreferredSize( new java.awt.Dimension( 200, 200 ) );
   this.getContentPane().add( wwd, java.awt.BorderLayout.CENTER );
   this.pack();
   wwd.setModel( new BasicModel() );
  }
 }

 public static void main( String[] args ) {

  java.awt.EventQueue.invokeLater( new Runnable() {

   public void run() {
    new AppFrame().setVisible( true );
   }
  } );

 }

}

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.