the-unreal
the-unreal

Reputation: 109

How to resolve "Error: Could not find or load main class FirstProgram" while running OpenCV Java in Eclipse?

I have started learning OpenCV Java and this is the program I have written to test the OpenCV setup:

import org.opencv.core.Core;
import org.opencv.core.CvType;
import org.opencv.core.Mat;
public class FirstProgram 
{
    public static void main(String args[]) 
    {
        System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
        Mat mat = Mat.eye(3, 3, CvType.CV_8UC1);
        System.out.println(mat.dump());
    }
}

But on running this, Eclipse shows the error: "Error: Could not find or load main class FirstProgram Caused by: java.lang.ClassNotFoundException: FirstProgram"

I have already setup the user libraries and added the libraries to the project folder. (Screenshots linked)

How do I resolve this issue ?

Upvotes: 0

Views: 139

Answers (1)

howlger
howlger

Reputation: 34137

Eclipse 2019-03 (released March 2019) is too old for Java 13 (released September 2019).

Please upgrade to the current version (currently, Eclipse 2020-03).

Upvotes: 1

Related Questions