[vtkusers] Cone.java example hangs on Mac OS 10.3.9

Jennifer West jennifer.lorraine.west at gmail.com
Thu Aug 2 13:36:14 EDT 2007


Hi Mike,

Thanks for the suggestions, unfortunately it's still not working.

I had tried putting print statements in the code and I found that it is
getting into the main method -- it's stopping at the first line of code. i.e.
my code is as follows:

  public static void main (String []args) {
    System.out.println("create an instance of vtkConeSource");
    vtkConeSource cone = new vtkConeSource();
    System.out.println("set Height");
    cone.SetHeight( 3.0 );

and so "create an instance of vtkConeSource" gets printed but "set Height"
does not.

I did build VTK with RPATH set to OFF. I tried putting the libraries in
/Library/Java/Extensions/ and when I did that, I get the error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: VTKInit
but the code stops in exactly the same place as before (except before the
code just hung and the program did not exit)

Also I do seem to need to set the DYLD_LIBRARY_PATH as when I don't, I get
the error:
Loading Libraries
dyld: java can't open library: libvtkCommon.dylib.5.0  (No such file or
directory, errno = 2)
Trace/BPT trap

Jennifer

On 8/2/07, Mike Jackson <imikejackson at gmail.com> wrote:

>     Is your java program even making it into the main() method? can
> you put a system.out.println("Yep"); as the first line inside main()
> and see if that even gets output?
>
> Java needs to know where your native libraries are: It looks in a few
> default locations: /Library/Java/Extensions is one place. If you need
> it to look in other places I think there are command line options to
> the "java" command that can have the jvm look in other places.
>
> The knee jerk reaction to this is to just copy the VTK libs into /
> Library/Java/Extensions which may or may NOT work depending if you
> built VTK with RPATH ON or OFF. If you Built vtk with RPATH OFF then
> putting all the vtk libs in /Library/Java/Extensions may work.
>
> If you do not understand what the ramifications or setting the RPATH
> is then take a look through Apple's Dev Docs to find out. It is long
> and complicated.
>
> Hope some of that helps.
>
> With respect to 10.3.9 versus 10.4.x, I think they generally work the
> same as far as Java is concerned. Both have at least a 1.4 jvm. The c+
> + compiler may be different. GCC 3.3 versus 4.0 (default) under 10.4.
>
> --
> Mike Jackson   Senior Research Engineer
> Innovative Management & Technology Services
>
>
> On Aug 2, 2007, at 10:48 AM, Sean McBride wrote:
>
> > On 8/1/07 5:58 PM, Jennifer West said:
> >
> >> Thanks for the pointer to the article. I tried the workaround
> >> described
> >> there, but that did not solve the problem.
> >>
> >> I set the DYLD_LIBRARY_PATH as described in these instructions:
> >>
> >> http://public.kitware.com/pipermail/vtkusers/2006-July/085918.html
> >>
> >> Although those were written for OS 10.4 and I'm using 10.3.9 - not
> >> sure if
> >> that makes a difference.
> >
> > As I've said, I don't know Java..... but I think that post is mostly
> > obsolete.  There were some CMake bugs wrt Java that have now been
> > fixed.
> >
> > Are you able to try in 10.4?  My feeling from the mailing list is that
> > few people are still using 10.3.  Is there a particular reason you are
> > on 10.3 still?
> >
> > --
> > ____________________________________________________________
> > Sean McBride, B. Eng                 sean at rogue-research.com
> > Rogue Research                        www.rogue-research.com
> > Mac Software Developer              Montréal, Québec, Canada
> >
> >
> > _______________________________________________
> > This is the private VTK discussion list.
> > Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/
> > Wiki/VTK_FAQ
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070802/c525b1d0/attachment.htm>


More information about the vtkusers mailing list