[vtkusers] OS X / Java bindings

Felix Fischer f.fischer at fh-aachen.de
Wed Mar 25 13:11:35 EDT 2009

Thanks everybody for your input!

Today I was able to successfully run VTK (5.2.1) on OS X with Java (5)  
I used a fresh 10.4 (PPC) installation, with installed XCode tools and  
CMake (2.6.3).
The essential settings are:

Shared Libraries: on
Java Bindings: on
Cocoa: on

No Carbon, and no X11 is needed since Cocoa is working.
The location of the resulting vtk.jar file is arbitrary, as long as it  
is included in the Java classpath.
The location of the resulting *.dylib files is also arbitry, as long  
as it is included in DYLD_LIBRARY_PATH (thanks Matthias!).

Later I will try to do the same on 10.5 with Java6 on an Intel-machine.

Thanks again

Am 24.03.2009 um 20:42 schrieb Eric E. Monson:

> Hey Felix,
> The two environment variables that (for me, at least) need to be set  
> export CLASSPATH=$CLASSPATH:/Users/emonson/Programming/VTK_cvs/VTK/ 
> build/bin/vtk.jar:.
> export JAVA_LIBRARY_PATH=$JAVA_LIBRARY_PATH:/Users/emonson/ 
> Programming/VTK_cvs/VTK/build/bin
> -Eric
> ------------------------------------------------------
> Eric E Monson
> Duke Visualization Technology Group
> On Mar 24, 2009, at 12:54 PM, Michael Jackson wrote:
>> It has been a looooong time since I used java but isn't there  
>> something about the CLASAPATH setting that needs to also point to  
>> your .jnilibs in addition to the normal java jar files?
>> Just a thought.
>> ---
>> Mike Jackson                 www.bluequartz.net
>> On Mar 24, 2009, at 12:28 PM, Felix Fischer wrote:
>>> Hi all,
>>> at http://public.kitware.com/Bug/view.php?id=7137 I have found a  
>>> bug report that is telling me that is possible to run VTK on OS X  
>>> with Java bindings. The past days I have tried the same, but  
>>> without success. Both on Windows and Linux it compiled  
>>> successfully und runs perfectly.
>>> On OS X there are (runtime) problems. I have tried Carbon, Cocoa  
>>> and X11 settings. Compilation with Java bindings is always fine.  
>>> When starting any VTK example (e. g. Cone), it gives  
>>> "java.lang.UnsatisfiedLinkError" when processing the vtkCommon  
>>> library (the libvtk*.dylib / *.jnilib files are definitively  
>>> found, LD_LIBRARY_PATH is set).
>>> I tried 10.4 and 10.5, both on a PPC and an Intel-machine. I tried  
>>> Java5 and Java6 (Intel). I tried 32 Bit and 64 Bit (10.5, Java6).  
>>> I tried XCode IDE and "pure" gcc/g++. It is always the same  
>>> (negative) result: compilation is fine (all libraries are  
>>> created), but at runtime it crashes.
>>> "otool -L" does not show any missing dependencies.
>>> There must be something that I am missing here. It would be great  
>>> if somebody can give me a hint.
>>> Thanks a lot
>>> Felix
>>> _______________________________________________
>>> Powered by www.kitware.com
>>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.vtk.org/mailman/listinfo/vtkusers

More information about the vtkusers mailing list