After integrating my vtk.jar and setting the library path in eclipse for use with the Java wrappers, the examples run fine in debug mode. But, in release mode, it can’t load the vtk native libraries; vtkNativeLibrary.LoadAllNativeLibraries() returns a null.
first of all, which OS are you testing on, and which VTK version are you using?
In VTK 9.0, vtkNativeLibrary.LoadAllNativeLibraries() returns a “boolean”, hence it cannot return a “null”.
Also, please check whether UnsatisfiedLinkError exceptions are thrown. If yes, please provide the exact stack trace, which will tell us a lot.
I don’t have much experience with Eclipse, but I would ensure that the “-Djava.library.path” system property is passed to the “java” command even when you run your project in “Release” mode.
Are you using a block of code like this?
if (!vtkNativeLibrary.LoadAllNativeLibraries())
{
for (vtkNativeLibrary lib : vtkNativeLibrary.values())
{
if (!lib.IsLoaded())
{
System.out.println(lib.GetLibraryName() + " not loaded");
}
}
}
Thanks Marco for your response. OK, that’s true, it dose return a boolean which is false. It’s inside on the LoadAllNativeLibraries() function that a null is returned and then the boolean is returned to the parent caller. I use the setProperty("vtk.lib.dir: ", vtkLibPath). This works fine in debug mode. But I will see if that path is different for release mode. Thanks.