Eclipse MapServer libmapscript.so: cannot open shared object file

Norman Barker nbarker at ITTVIS.COM
Wed Jul 19 12:22:17 EDT 2006


-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On
Behalf Of Ryan Ollerenshaw
Sent: Wednesday, July 19, 2006 5:16 PM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: [UMN_MAPSERVER-USERS] Eclipse MapServer libmapscript.so: cannot
open shared object file

When trying to create a java application using eclipse i get the
following
error:

java.lang.UnsatisfiedLinkError: libmapscript: libmapscript.so: cannot
open
shared object file: No such file or directory

Here is my code:

import  edu.umn.gis.mapscript.*;
import java.io.*;

public class HelloServlet {

	public static void main(String[] args) {

	System.loadLibrary("mapscript");
	      mapObj  map;
	      imageObj image;

	      map=new
mapObj("/var/www/html/mapserver/htdocs/display.map");
	      map.setProjection("init=epsg:4326");
	      image=map.draw();
	      image.save("test.png",map);
    }
}

Ryan,

You need to add the path variable to eclipse, so in eclipse do the
following

Run -> Run -> (select your configuration) -> Environment -> add a
variable called path and set it to /usr/local/lib (or /usr/lib)

Similary in Tomcat, or JBoss, you need to add -Djava.library.path=... to
run.bat

Norman



More information about the mapserver-users mailing list