[vtkusers] java.lang.UnsatisfiedLinkError to native lib using VTK with Java

Amy Squillacote ahs at cfdrc.com
Wed Apr 23 09:32:43 EDT 2008


In your java code, are you loading the vtk*Java libraries? The code 
would look something like the following.Also, is the path to the 
vtk*Java.dll files in your path?

static
  {
  System.loadLibrary("vtkCommonJava");
  System.loadLibrary("vtkFilteringJava");
  ...
  }

- Amy

Timothy Driscoll wrote:
> hi,
>
> I'm trying to use VTK within the context of a Java application.  I 
> compiled it with Java wrappings, and added the path to the vtk.jar 
> file to my runtime classpath.  I also added the path to the bin 
> directory to java.library.path.
>
> I keep getting this runtime error when I try to call vtkPoints():
>
> Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: 
> VTKInit
>         at vtk.vtkPoints.VTKInit(Native Method)
>         at vtk.vtkObject.<init>(vtkObject.java:96)
>         at vtk.vtkPoints.<init>(vtkPoints.java:183)
>
>
> so it seems to me that my app is finding the Java wrappings just fine, 
> but can't find the native C++ libraries? (or at least, not VTKInit!).  
> this happens both from command line and from NetBeans. (fwiw, I'm 
> running under OS X 10.4.11, Java 1.5.0_07.)
>
> can anyone please help?
>
>
> thanks a lot,
>
> tim

-- 
Amy Squillacote                    Phone: (256) 726-4839
Computer Scientist                 Fax: (256) 726-4806
CFD Research Corporation           Web: http://www.cfdrc.com
215 Wynn Drive, Suite 501
Huntsville, AL  35805





More information about the vtkusers mailing list