First exercise using Java Mapscript

Peter Lee (Planning Data Factory) peter.lee at PLANNINGDATAFACTORY.COM.AU
Thu Oct 18 23:13:14 PDT 2007


Dear List,

I have some experience using Mapserver CGI but am a newie to Java Manpscript. I tried to compile my first program in windows XP with the error:

import edu.umn.gis.mapscript.*;

public class mapscript_basic {
   public static void main(String[] args) {
      System.loadLibrary("mapscript");

      mapObj mapobject;
      imageObj mapimage;
      String mapfile;

      // set the map file to use
      mapfile = "global.map";
      
      // create a mapObj, initilized with the mapfile above
      mapobject = new mapObj(mapfile);

      // create an imgObj that has an image of the map
      mapimage = mapobject.draw();

      // save the mapimage to a file
      mapimage.save("worldmap.png",mapobject);
   }
}

Error:
mapscript_basic.java:1: package edu.umn.gis.mapscript does not exist
......

In fact, I have placed the two library files mapscript.jar and mapscript.dll in the folder JAVA_HOME\lib and set the env variable CLASSPATH  to JAVA_HOME\lib.

I got the files from the ms4w download ver 2.2.6. The library files are located at the folder C:\ms4w\Apache\cgi-bin\mapscript\java.

Any help to solving the problem will be greatly appreciated.



Peter



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20071019/93af5fe4/attachment.htm>


More information about the MapServer-users mailing list