[vtkusers] VTK and Java

Jeff Lee jeff at cdnorthamerica.com
Tue Jul 9 06:36:21 EDT 2002


Raphael Sebbe wrote

>
> - jni.h path (and others)
> - Mac OS X uses .jnilib as native shared library extension, using 
> .dylib (standard on OS X) means the Java VM won't be able to load the 
> native code.
> - adding "-framework JavaEmbedding.framework" to the linker flags

Those are probably issues which need to be addressed in CMake

>
> - I saw in one file (don't remember which one) that a correspondance 
> was made between Java AWT frame and native one, I guess this could be 
> easily implemented if one chooses Carbon backend as Java AWT is 
> implemented in terms of Carbon (and appropriate definitions can be 
> found in jawt_md.h

vtkJavaAWT.h is the file, and it should be fine - it includes jawt_md.h.

>
> I am not fluent at all with CMake, but I guess most environment 
> changes should be handled there.

Yes

>
>
> Also, I came across a problem when using Java, I have to explicitely 
> invoke VTKInit() on each new Java instance of VTK classes, as it is 
> not called from the Java constructor (as far as I can see from a cross 
> Java/GDB debugging session). Otherwise I get a bad access on the first 
> VTK function call, as it can't establish the Object <-> Pointer 
> relation. This was not the case on the last nightly build I used (I am 
> now working from CVS), and as a result, java examples and tutorials do 
> not work. Any idea ?

This has been fixed as of 7/8/02 - get the cvs version of vtk.

Hope this helps,
-Jeff





More information about the vtkusers mailing list