Ask Your Question

Revision history [back]

opencv_java400.dll: Can't find dependent libraries on windows server

java code:
System.loadLibrary(Core.NATIVE_LIBRARY_NAME); Mat image = Imgcodecs.imread(path1); String path=this.getClass().getResource("/opencv/haarcascade_frontalface_alt.xml").getPath(); if(path.startsWith("/")){ path=path.substring(1, path.length()); } CascadeClassifier faceDetector = new CascadeClassifier(path); MatOfRect faceDetections = new MatOfRect(); faceDetector.detectMultiScale(image, faceDetections); System.out.println(String.format("Detected %s faces", faceDetections.toArray().length)); result=faceDetections.toArray().length;

it's run well on win10 tomcat8 jdk8,but when i publish it to windows server 2008 or 2012,always return opencv_java400.dll: Can't find dependent libraries,i tried 2 days to solve this question but failed,please help me!

click to hide/show revision 2
None

updated 2018-10-31 06:11:25 -0600

berak gravatar image

opencv_java400.dll: Can't find dependent libraries on windows server

java code:

 System.loadLibrary(Core.NATIVE_LIBRARY_NAME);                                                                                        
   Mat image = Imgcodecs.imread(path1);                                                                                        
   String path=this.getClass().getResource("/opencv/haarcascade_frontalface_alt.xml").getPath();                                                                                        
   if(path.startsWith("/")){                                                                                        
                     path=path.substring(1, path.length());                                                                                        
   }                                                                                        
   CascadeClassifier faceDetector = new CascadeClassifier(path);                                                                                        
   MatOfRect faceDetections = new MatOfRect();                                                                                        
   faceDetector.detectMultiScale(image, faceDetections);                                                                                        
   System.out.println(String.format("Detected %s faces", faceDetections.toArray().length));                                                                                        
   result=faceDetections.toArray().length;result=faceDetections.toArray().length;

it's run well on win10 tomcat8 jdk8,but when i publish it to windows server 2008 or 2012,always return opencv_java400.dll: Can't find dependent libraries,i tried 2 days to solve this question but failed,please help me!