[mapserver-users] Java Wrapper for mapserver

Sathiskumar Govindasamy gsathis at yahoo.com
Thu Feb 21 10:52:26 EST 2002


Steve,

To my experience, You are right. Once you are done with swigging, the 
java code is not ready to compile rightway. I got some 70+ errors. But 
those are simple corrections. Few missing 'long's in parameter type of a 
function or return type of a function. In all the java programs check 
for variables "rect" & "img" which are missing its datatype which is 
long. Also, in couple of instances 'class' is defined as variable name 
and since it is reserved word, it will fail to compile. In two places a 
function is defined twice and you have to comment out one.

I know Harald have done the same. If you want, I can send you the 
corrected java code. It would be great if there is a consistency between 
all the mapscript implementations. I looked into perl module, and it is 
very close to java's. I did not find the imageObj in that too. Instead 
it uses the same msSaveImage function from the native code.

Good luck with your java trial.

Sathis

Harald Wehr wrote:

> Steve Lime wrote:
>
>> I've talked to the PHP folks and we will add an imageObj to the main 
>> mapscript to maintain compatability between them.
>>
>> One other thing, I've had no problem getting the shared library to 
>> compile but am having a heck of time compiling the java class files. 
>> With swig I do a:
>>
>>   swig -java -shadow -package mapscript mapscript.i
>>
>> but when compiling even a simple class like colorObj.java javac 
>> whines about not being able to resolve mapscript.whatever. Seems to 
>> be hung on the package name. Anyway, I'm not a java guru and am 
>> trying to write a Makefile based procedure to add to the 
>> distribution. I realize there are other hacks that have to be made to 
>> the .java files (will try to script those) but obviously I'm doing 
>> something stupid if I can't even get the most simple file to build. 
>> Note that I'm moving all of the .java files into their own directory 
>> apart from the C stuff. Ideas?
>
>
> Hi Steve,
>
> can you give the exact error message? When you "swigg" mapscript to
> java-files as package "mapscript" they all must be in a directory
> called "mapscript". Then you compile with:
>
> javac mapscript/*.java
>
> and it should work.
>
> Harald






More information about the mapserver-users mailing list