I'm trying to install and configure JavaCV and OpenCV on ubuntu 14.04 .

Installed under the article and according to official instructions . I work in Eclipse .

In the properties of the project in the Run / Debug Settings item in the VM arguments field, added the line:

-Djava.library.path="/home/ant/opencv-3.0.0/lib 

Trying to run the code from the example from the official site:

 import java.io.BufferedReader; import java.io.File; import java.io.IOException; import java.io.InputStreamReader; import static org.bytedeco.javacpp.opencv_core.*; import static org.bytedeco.javacpp.opencv_imgproc.*; import static org.bytedeco.javacpp.opencv_imgcodecs.*; public class Main { public static void main(String[] args) { BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); String filename = null; try { filename = bf.readLine(); } catch (IOException e) { System.out.println(e); } File file = new File(filename); System.out.println(file.exists()); IplImage image = cvLoadImage(filename); if (image != null) { cvSmooth(image, image); cvSaveImage(filename, image); cvReleaseImage(image); } } } 

The file itself is found, but the cvLoadImage() function does not execute, and the program crashes and displays to the console:

Java HotSpot (TM) 64-Bit Server VM warning: You have loaded the library /home/ant/opencv-3.0.0/lib/libopencv_core.so.3.0.0 which might have disabled stack guard. Try to fix the stack guard now. It is execstack -c <libfile> or -z noexecstack.

How to fix it?

    1 answer 1

    It is execstack -c <libfile> or -z noexecstack.

    transfer:

    correct this library by running:

     $ execstack -c /home/ant/opencv-3.0.0/lib/libopencv_core.so.3.0.0 

    or adding (apparently, in the same vm arguments field) the string -z noexecstack .


    in the second paragraph (after “or”) only my guess is stated: I do not know how libraries are linked in eclipse and where you can add parameters for this link.

    • Thank. Run through the terminal: execstack -c /home/ant/opencv-3.0.0/lib/libopencv_core.so.3.0.0 And now it runs without errors. - Anton Wozniaa