[vtkusers] A step forward and stuck again: VTK, Mac OS, Java, SOLVED! partially

Kustaa Nyholm Kustaa.Nyholm at planmeca.com
Tue Feb 20 03:07:06 EST 2007


>>> Bernard Giroux <giroux at geo.polymtl.ca> 19.2.2007 17:07 >>>

>Does DYLD_LIBRARY_PATH contains the directory where *jnilib and *dylib
are?
Ah, great suggestion, this cured the problem!
BTW isn't there something wrong if I need that? Knowing nothing about
this (I assume it
is some python stuff) I googled about a bit on this and someone said
that
it should not be necessary to set this if everything is configured
properly, what ever
that means...

But the great thing is that I I *can* now compile and run VTK using
Java on Mac OS!

 It does not work yet, though, :-(

Nothing happens when I try the sample code.


But to recap success so far, for the benefit of those who may read this
later:

I'm working with:

VTK 5.0.2 from source code
Mac OS X 10.4.8 (on Dual Core Intel)
CMake 2.4.6 using binary from Mac .dmg image
Java version 1.5.0_07
JRE build 1.5.0_07-164
Hot Spot 1.5.0_07-87

To get it to compile I did the following AFAIK:

ccmake .
   BUILD_SHARED_LIBS ON
   VTK_WRAP_JAVA ON
   JAVA_AWT_INCLUDE_PATH
/System/Library/Frameworks/JavaVM.framework/Headers
   [c]onfigure and [g]enerate

then edited manually CMakeCache.txt to add the following entry:

JAVA_AWT_LIBRARY:STRING=-framework JavaVM
   
after which I was able to compile it with make

To be able to run it (in Eclipse) I did the following:

project->properties->java build path->libraries->ddd external jar->
browse to /Users/username/vtk/bin/vtk.jar

expand the vtk.jar in the same dialog, double click on the native
library location and enter /Users/username/vtk/bin

create a run/debug configuration and in the Environment tab add
DYLD_LIBRARY_PATH with value /Users/username/vtk/bin

Now the code compiles and executes but nothing happens! 

the code I'm running is verbatim from 
http://public.kitware.com/VTK/example-code.php 

Single stepped through it and the libraries get loaded and no
exceptions are reported but the code seems to hang inside
the very last call of the program which calls
vtkRenderWindowInteractor.start(). The application does not quit and is
consuming no CPU time but nothing is seen. Need to dig deeper to this,
just rushed off to report success so far 
and thank everybody. Having said that I would love to get some pointers
forward...

br Kusti






Kustaa Nyholm
Research Manager, Software
Research and Technology Division
PLANMECA OY
Asentajankatu 6
00880 HELSINKI
FINLAND

Please note our new telephone and fax numbers!
Tel: +358 20 7795 572 (direct)
Fax: +358 20 7795 676
GSM: +358 40 580 5193
e-mail: kustaa.nyholm at planmeca.com 

This e-mail may contain confidential or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden. We will not be liable for direct,
indirect, special or consequential damages arising from alteration of
the contents of this message by a third party or as a result of any
virus being passed for viruses.





More information about the vtkusers mailing list