[vtkusers] Exception java.lang.UnsatisfiedLinkError

Lars Matthäus lars.matthaeus at web.de
Tue Nov 6 12:40:51 EST 2007


> Any idea of what to do???

The usual stuff:

a) Add vtk library directory (with .dll / .so files) to PATH
b) Add vtk.jar to your project
c) load the vtk libraries at start of the java-program, e.g.:

public class Test {

	static {
		try {
			System.loadLibrary("vtkHybridJava");
		} catch (final Throwable e) {
			System.out.println("cannot load vtkHybridJava, skipping...");
		}
		try {
			System.loadLibrary("vtkWidgetsJava");
		} catch (final Throwable e) {
			System.out.println("cannot load vtkWidgetsJava, skipping...");
		}
		try {
			System.loadLibrary("vtkVolumeRenderingJava");
		} catch (final Throwable e) {
			System.out.println("cannot load vtkVolumeRendering, skipping...");
		}
		try {
			System.loadLibrary("vtkParallelJava");
		} catch (final Throwable e) {
			System.out.println("cannot load vtkParallel, skipping...");
		}
	}

	public static void main(final String[] argv) {
		...
	}

}


> Exception in thread "main" java.lang.UnsatisfiedLinkError: vtk.vtkCubeAxesActor2D.VTKInit()V
>         at vtk.vtkCubeAxesActor2D.VTKInit(Native Method)
>         at vtk.vtkObject.<init>(C:/martink/vtk42/vtkdist/java/vtk/vtkObject.java:98)
>         at vtk.vtkProp.<init>(C:/martink/vtk42/vtkdist/java/vtk/vtkProp.java:114)
>         at vtk.vtkActor2D.<init>(C:/martink/vtk42/vtkdist/java/vtk/vtkActor2D.java:130)
>         at vtk.vtkCubeAxesActor2D.<init>(C:/martink/vtk42/vtkdist/java/vtk/vtkCubeAxesActor2D.java:378)
>         at vtks.CubeAxes.main(CubeAxes.java:112)
> Java Result: 1



More information about the vtkusers mailing list