[mapserver-users] Re: Java Mapscript

Sathiskumar Govindasamy gsathis at hashprompt.com
Thu Apr 18 11:37:04 PDT 2002


Andreas,

This is what I did.

I got the mapserver source code and untarred it and did the following

./configure --with-jpeg --with-gd --with-proj 
--with-gdal=/usr/local/bin/gdal-config
make

Then I got the SWIG Version 1.3.11 source.

./configure --with-javac=/usr/java/j2sdk1.4.0/bin/ 
--with-java=/usr/java/j2sdk1.4.0/bin/ 
--with-javaincl=/usr/java/j2sdk1.4.0/include/
make
make install

I created a directory called java in mapserver-src/mapscript and created 
a symlink for mapscript.i inside it.  (In the new nightly builds, you 
might not need this step since it should be already in there)

/usr/local/bin/swig -java -shadow -package mapscript mapscript.i

It created some java files.
Then I did
FLAGS="-DUSE_PROJ -DUSE_PROJ_API_H -DUSE_GD_PNG -DUSE_GD_JPEG 
-DUSE_GD_WBMP -DUSE_GD_FT -DUSE_WMS -DUSE_TIFF -DUSE_JPEG -DUSE_EPPL 
-DUSE_GDAL"gcc -fpic -c $FLAGS -I/usr/java/j2sdk1.4.0/include 
-I/usr/java/j2sdk1.4.0/include/linux mapscript_wrap.c
gcc -fpic -shared -o libmapscript.so -L/usr/lib -lgd -ljpeg -lfreetype 
-lpng -lz -ltiff  -L/usr/local/lib -lgdal.1.1 -lproj mapscript_wrap.o 
../../libmap.a


Java programs didn't compile right off the bat. I need to correct all 
those 'long' variable types and return types. Then it compiled. (New 
nightly build should compile clean)

In tomcat, I added the following line in /etc/tomcat4/conf/tomcat4.conf

export LD_LIBRARY_PATH=/opt/mapserver/mapscript/java:$LD_LIBRARY_PATH

I have the mapserver installed on /opt/

I have attached a servlet sample .

Thanks
Sathis
Andreas Hirner wrote:

> Hello,
>
> I have been able to compile mapserver 3.5 on Linux/Suse 7.3 and got 
> the demo running. Now I am thinking of using Java mapscript within Jsp 
> Pages.
> Does anybody know how to go about this. Do I have to use Swig to 
> create the Java sources from the nightly builds or are there other 
> Java sources available. Is the functionality or reliability of Java 
> mapscript similar to that of the Perl or PHP versions or are there any 
> limitations. Are there any manuals covering the usage of Java 
> mapscript. And so on..
> I would appreciate any information or hints concerning the compilation 
> and usage of Java mapscript in the linux environment.
>
> Thanks in advance
> Andreas Hirner
>
>
> _________________________________________________________________
> Chat with friends online, try MSN Messenger: http://messenger.msn.com



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20020418/b3c0f700/attachment.htm>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: map.java
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20020418/b3c0f700/attachment.ksh>


More information about the MapServer-users mailing list