[vtkusers] java.lang.UnsatisfiedLinkError: VTKInit

Chase Yarbrough vergil at gmail.com
Wed Aug 2 00:36:26 EDT 2006


Hi Yu,

It seems that you relocated the vtk libraries after you built them.  Did 
you turn CMAKE_SKIP_RPATH to ON?  If not, this could be your problem.  
See 
http://www.duke.edu/~iwd/howto/VTK-Linux-Java_HOWTO.html#Update_20_Mar_2003

Chase

Yu Kang wrote:
> Hi Chase
>
> I set my enviroment
> export VTK_DIR=/usr/local/vtk
> export LD_LIBRARY_PATH=${VTK_DIR}/bin:${VTK_DIR}/java:$LD_LIBRARY_PATH
> export PATH=$LD_LIBRARY_PATH:$PATH
>
> But  the error is still there,
>
> Exception in thread "main" java.lang.UnsatisfiedLinkError: VTKInit
>         at vtk.vtkConeSource.VTKInit(Native Method)
>         at vtk.vtkObject.<init>(vtkObject.java:90)
>         at vtk.vtkAlgorithm.<init>(vtkAlgorithm.java:246)
>         at vtk.vtkPolyDataAlgorithm.<init>(vtkPolyDataAlgorithm.java:58)
>         at vtk.vtkConeSource.<init>(vtkConeSource.java:114)
>         at Cone.main(Cone.java:36)
>
> In the directory /usr/local/vtk/java/vtk, I can find the files 
> vtkConeSource.class and vtkConeSource.java also in the jar package 
> /usr/local/vtk/bin/vtk.jar.
> The  vtk share library files (*.so *.so.5.0  *.so.5.0.1) are in the 
> directory /usr/loca/vtk/bin
>
> My cmake version is 2.2.3, does this cause the promble?
>
> 2006/8/1, Chase Yarbrough <vergil at gmail.com <mailto:vergil at gmail.com>>:
>
>     Hi Yu,
>
>     Now it seems that the problem is that the vtk libs are not in your
>     path.  Try adding them to your path.  Just append the vtk/bin/release
>     directory (or wherever your libraries are) to your PATH environment
>     variable.
>
>     Chase
>
>     Yu Kang wrote:
>     > Hi Chase
>     > thanks for your reply.
>     > I try the command
>     > java -classpath /usr/local/vtk/bin/vtk.jar:. Cone
>     > now I get the same error message when I use IDE to run
>     > in thread "main" java.lang.UnsatisfiedLinkError: VTKInit
>     >         at vtk.vtkConeSource.VTKInit(Native Method)
>     >         at vtk.vtkObject.<init>(vtkObject.java:90)
>     >         at vtk.vtkAlgorithm .<init>(vtkAlgorithm.java:246)
>     >         at
>     vtk.vtkPolyDataAlgorithm.<init>(vtkPolyDataAlgorithm.java:58)
>     >         at vtk.vtkConeSource.<init>(vtkConeSource.java:114)
>     >         at Cone.main (Cone.java:36)
>     >
>     >
>     > 2006/7/30, Chase Yarbrough <vergil at gmail.com
>     <mailto:vergil at gmail.com> <mailto:vergil at gmail.com
>     <mailto:vergil at gmail.com>>>:
>     >
>     >     Hi Yu,
>     >
>     >     It seems that you've left the current directory off your
>     classpath, so
>     >     it can't find cone.class.  Try
>     >
>     >     java -classpath /usr/local/vtk/bin/vtk.jar:. Cone
>     >
>     >
>     >     HTH,
>     >     Chase
>     >
>     >     Yu Kang wrote:
>     >     > vtk 5.0
>     >     > j2sdk 1.4.2_08
>     >     > gcc 3.4.3
>     >     > BUILD_SHARED_LIBS = ON
>     >     >
>     >     > export VTK_DIR=//usr/local/vtk
>     >     > export LD_LIBRARY_PATH=$VTK_DIR/bin:$LD_LIBRARY_PATH
>     >     >
>     >     > compiling and executing Cone.java
>     >     >
>     >     > javac -classpath /usr/local/vtk/bin/vtk.jar
>     >     > Cone.java
>     >     > java -classpath /usr/local/vtk/bin/vtk.jar Cone
>     >     >
>     >     > Exception in thread "main" java.lang.NoClassDefFoundError
>     : Cone
>     >     >
>     >     > In eclipse IDE with the same source code, I get the following
>     >     > Exception in thread "main"
>     >     > java.lang.UnsatisfiedLinkError: VTKInit
>     >     >       at vtk.vtkConeSource.VTKInit(Native Method)
>     >     >       at vtk.vtkObject.<init>( vtkObject.java:90)
>     >     >       at vtk.vtkAlgorithm.<init>(vtkAlgorithm.java:246)
>     >     >       at vtk.vtkPolyDataAlgorithm
>     >     > .<init>(vtkPolyDataAlgorithm.java :58)
>     >     >       at vtk.vtkConeSource.<init>(vtkConeSource.java:114)
>     >     >       at Cone.main(Cone.java:35)
>     >     > also I get the java.library.path:
>     >     >
>     >    
>     /usr/java/j2sdk1.4.2_08/jre/lib/i386/client:/usr/java/j2sdk1.4.2_08/jre/lib/i386:/usr/java/j2sdk1.4.2_08/jre/../lib/i386:/usr/local/vtk/bin:/usr/lib/mozilla-
>
>     >
>     >     > 1.7.3
>     >     >
>     >     > I try some suggestions on internet but result doesn't change.
>     >     > any help will be appreciated
>     >     >
>     >     >
>     >    
>     ------------------------------------------------------------------------
>
>     >     >
>     >     > _______________________________________________
>     >     > This is the private VTK discussion list.
>     >     > Please keep messages on-topic. Check the FAQ at:
>     >     http://www.vtk.org/Wiki/VTK_FAQ
>     <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