在Java中使用GDCM - 如何包含?

时间:2015-05-30 13:41:10

标签: java gdcm

我想在Java中使用GDCM,但不知何故我使用它失败了。我为win x86下载了预编译文件。我从来没有尝试过包含一个SWIG库,所以我可能做错了。我试图将gdcm.jar包含在原始文件夹中,并作为副本。

我做了什么(使用Netbeans):     在Project-> Properties-> Libraries-> Compile-> Add Jar

中添加了gdcm.jar

错误:

java.lang.reflect.InvocationTargetException
...
Caused by: java.lang.UnsatisfiedLinkError: gdcm.gdcmJNI.swig_module_init()V
at gdcm.gdcmJNI.swig_module_init(Native Method)
at gdcm.gdcmJNI.<clinit>(gdcmJNI.java:2751)

如何正确使用它?非常感谢!

1 个答案:

答案 0 :(得分:1)

您需要使用以下命令将libgdcmjni.jnilib添加到java中的库路径:

-Djava.library.path="Path to directory that contains libgdcmjni.jnilib"