【问题标题】:Java: Eclipse crashes(linux)Java:Eclipse 崩溃(Linux)
【发布时间】:2018-03-13 08:35:17
【问题描述】:

我正在使用 eclipse 4.6.3 和 ubuntu Budge(17.04)

我正在尝试调用另一个类的方法。在那种方法中,我完成了一些 opencv 任务。但是每当我尝试调用和编译时,它都会显示此消息。

# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f711102daf7, pid=7567, tid=0x00007f70b010d700
#
# JRE version: OpenJDK Runtime Environment (8.0_131-b11) (build 1.8.0_131-8u131-b11-2ubuntu1.17.04.3-b11)
# Java VM: OpenJDK 64-Bit Server VM (25.131-b11 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V  [libjvm.so+0x67daf7]  jni_GetStringUTFChars+0x87
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /home/aritra/workspace/ProjectHetero/hs_err_pid7567.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp

我调用的方法是

public  static String FaceDetection(String Path) {

        System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
        String file=Path;
        Mat src = Imgcodecs.imread(file);
        //instamting classifier
        //String xmlFile="/home/aritra/opencv-3.2.0/data/lbpcascade_frontalface.xml";
        CascadeClassifier classsifier= new CascadeClassifier();
        classsifier.load("haarcascade_frontalface_alt.xml");
    try {


        //detecting face
        MatOfRect faceDetections= new MatOfRect();
        classsifier.detectMultiScale(src, faceDetections);
        //System.out.println(String.format("Detected %s faces",faceDetections.toArray().length));
        for(Rect rect : faceDetections.toArray()){

            Imgproc.rectangle(src,
                    new Point(rect.x,rect.y),
                    new Point(rect.x+rect.width,rect.y+rect.height),
                    new Scalar(0,0,255),
                    3);
        }
            Imgcodecs.imwrite("/home/aritra/workspace/ProjectHetero/Output/OutputPic652.jpg",src);
            //System.out.println("Image Processesd");
        //  File picture= new File("/home/aritra/workspace/oopencv/picture/outputPic652.jpg");
        //  open(picture);

    }
    catch (Exception e) {
        // TODO: handle exception
    }
        String OutputPath ="/home/aritra/workspace/ProjectHetero/Output/OutputPic652.jpg";
        return(OutputPath);

    }


 public static void open(File document) throws IOException {
    Desktop dt = Desktop.getDesktop();
    if(Desktop.isDesktopSupported()){
        new Thread(()-> {
            try {
                dt.open(document);
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }).start();  

    }

    }

我已经单独检查了我的方法。它工作正常。我还检查了之前在同一问题上提出的问题,并通过添加它在 config.ini 文件中进行了更改。 Eclipse continue crashing

org.eclipse.swt.browser.DefaultType=mozilla
org.eclipse.swt.browser.XULRunnerPath=/home/aritra/Desktop/XUL RUNNER/xulrunner

但仍显示此消息。我发现只有在我调用这些方法时才会出现此消息。无法理解问题出在哪里。有人可以帮我吗??

【问题讨论】:

  • 你试过这个吗:To enable core dumping, try "ulimit -c unlimited" before starting Java again
  • 是的,我也试过了。但什么也没发生
  • 你能建议我更新我的问题吗? @拖延者

标签: java eclipse opencv crash


【解决方案1】:

根据您的说法,每当您调用该方法时都会出现问题。正确的? 所以我检查了你的方法open()FaceDetection() 对我来说似乎很好。但我认为,每当您调用这些方法时,您都在传递错误的参数。我猜您正在传递null。这就是您收到此消息的原因。你会再次检查吗?

【讨论】:

    猜你喜欢
    • 2011-12-10
    • 1970-01-01
    • 1970-01-01
    • 2011-03-21
    • 2011-10-19
    • 2020-10-28
    • 2015-03-25
    • 1970-01-01
    • 2013-11-07
    相关资源
    最近更新 更多