简体   繁体   中英

Using VTK 5.4.2 with Java in OS X 10.6

Has anybody successfully ran any Java code using VTK 5.4.2 under OS X?

I've installed VTK 5.4.2 from source, configured for Java and shared libraries. The vtk.jar file is generated as expected, and the Java program compiles correctly. However, when executing, as soon as the wrapper classes call the underlying *.dylib libraries, it appears that only the first library loads, and its dependencies are not found even if they are in the same directory as the first library loaded.

When running using Netbeans, the error I am getting is:

Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/lib/java/libvtkFilteringJava.dylib: Library not loaded: libvtkCommonJava.5.4.dylib
Referenced from: /usr/lib/java/libvtkFilteringJava.dylib Reason: image not found at java.lang.ClassLoader$NativeLibrary.load(Native Method)

Any ideas?

Thanks- Carlos

If you add a System.outprintln for System.setProperty("java.library.path"); does it include the directory where ibvtkCommonJava.5.4.dylib?

Also are you running a mix of 32/64 bit on the machine?... and if so is the library compiled for the same as the VM you are using (64-bit VM + 64-bit library or 32-bit VM and 32-bit library).

This talks about the library path: http://www.java-tips.org/other-api-tips/jni/simple-example-of-using-the-java-native-interface.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM