简体   繁体   English

Java:Eclipse 崩溃(Linux)

[英]Java: Eclipse crashes(linux)

I am using eclipse 4.6.3 and ubuntu Budge(17.04)我正在使用 Eclipse 4.6.3 和 ubuntu Budge(17.04)

I am trying to call a method from another class.我正在尝试从另一个类调用方法。 In that method I have done some opencv task.在那种方法中,我完成了一些 opencv 任务。 But whenever I tried to call and compile, it shows this message.但是每当我尝试调用和编译时,它都会显示此消息。

# 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

And methods I am calling are我调用的方法是

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();  

    }

    }

I have checked my method separately.我已经单独检查了我的方法。 It works fine.它工作正常。 I have also checked previous questions asked on this same issue and changed in config.ini file by adding this.我还检查了之前在同一问题上提出的问题,并通过添加它在 config.ini 文件中进行了更改。 Eclipse continue crashing Eclipse 继续崩溃

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

But still showing this message.但仍然显示此消息。 I have find out that this message appears only when I am calling those methods.我发现只有在调用这些方法时才会出现此消息。 Unable to understand where the problem is.无法理解问题出在哪里。 Can some one help me please??有人能帮助我吗??

According to you the problem is occurring whenever you call the method.根据您的说法,只要您调用该方法,就会出现问题。 right?对? So I have checked your method open() and FaceDetection() it seems fine to me.所以我检查了你的方法open()FaceDetection()对我来说似乎很好。 But I think whenever you are calling these methods you are passing wrong parameters.但是我认为每当您调用这些方法时,您都会传递错误的参数。 I guess you are passing null .Thats why you r getting this message.我猜您正在传递null这就是您收到此消息的原因。 Will you check it again?你会再次检查吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM