[vtkusers] Java wrapping in Mac OS X

Raphael Sebbe sebbe at multitel.be
Thu Jul 18 06:05:53 EDT 2002


Tested on Examples/Tutorial/Step1/Java, this works (but the extension is 
.dylib, not .dynlib in your script).

javac -classpath ../../../../java:. Cone.java
java -cp ../../../../java:. -Djava.library.path=../../../../bin Cone

BTW, other modifications are required for the Java wrapper to compile on 
OS X. Could you add those to CVS too ?

vtkJavaUtil.cxx, line 57
add  "|| defined(__MACH__)"

vtkJavaAwt.h, line 75 (I am a Cocoa guy and no Carbon expert, so hope 
this works)
// Cocoa <-> AWT is not possible at this time
#elif defined(VTK_USE_CARBON)
   jawt_MacDrawingSurfaceInfo* dsi_mac;
   dsi_mac = (jawt_MacDrawingSurfaceInfo*)dsi->platformInfo;
   temp0->SetWindowId((void *)dsi_mac->fQDWindow);

Those constants are not correctly detected

JAVA_AWT_INCLUDE_PATH:PATH=/System/Library/Frameworks/JavaEmbedding.framework/
Headers
JAVA_AWT_LIBRARY:FILEPATH=-framework JavaEmbedding
JAVA_INCLUDE_PATH:PATH=/System/Library/Frameworks/JavaVM.framework/Headers

I CCed this to the list as it can serve other users too in the mean time.

Raphael

On Wednesday, July 17, 2002, at 03:27 PM, Bill Hoffman wrote:

> Can you try something and let me know if it works?
> In the CMakeLists.txt file of Common, can you add the following:
> After this line:
>   ADD_LIBRARY(vtkCommonJava SHARED CommonJava_SRCS vtkJavaUtil)
> Add this code:
>
> IF(APPLE)
>   SET(CURRENT_KIT "Common")
>    ADD_CUSTOM_COMMAND(SOURCE vtkCommonJava
>      COMMAND ln
>      ARGS -s
>      ${LIBRARY_OUTPUT_PATH}/libvtk${CURRENT_KIT}Java.dynlib
>      ${LIBRARY_OUTPUT_PATH}/libvtk${CURRENT_KIT}Java.jnilib
>      TARGET vtkCommonJava)
> ENDIF(APPLE)
>
> Then re-run cmake, and remove the dynlib and jnilib for vtkCommon
> and re-make.   Let me know if this works.   If it does, I will
> make the changes on the vtk main tree.
>
> Thanks.




More information about the vtkusers mailing list