使用spring-boot-devtools导致在Eclipse下的UnsatisfiedLinkError问题

来源:互联网 发布:剑灵网络延迟高怎么办 编辑:程序博客网 时间:2024/05/30 19:33

在Eclipse中运行报UnsatisfiedLinkError错的原因:使用了spring-boot-devtools包,与java的System.loadLibrary冲突

解决方法自然就是在pom中去掉对spring-boot-devtools包的依赖

========================================================================

原文地址:https://stackoverflow.com/questions/43477908/java-spring-boot-application-with-opencv-unsatisfiedlinkerror-under-eclipse-if

I have made a Spring boot application (1.4.0) with OpenCv dependency also. I installed and configured OpenCv on my mac, I did must compile it for mac... I made a link in java_home/jre/lib/ to the external library /usr/local/share/OpenCV/java/libopencv_java320.dylib .


If I run the jar from terminal (not under eclipse) all it's all right, but if I run the application under Eclipse it can't find the native library and I get a java.lang.UnsatisfiedLinkError: org.opencv.imgcodecs.Imgcodecs.imread_1(Ljava/lang/String;)J when I make Mat matScreenshot = Imgcodecs.imread(absolutePathScreenshot);

I found an usefull post https://github.com/spring-projects/spring-boot/issues/3315 that take me to the right way:in my pom.xml I included the dependency spring-boot-devtools that conflict with the System.loadLibrary ...

When I turn off the dependency, the application run correctly under Eclipse too.

I found this solution after days of research, I put this 'answer' here hoping it will be helpfull
阅读全文
0 0
原创粉丝点击