title: Exception in thread "main" java.lang.NoClassDefFoundError: org/opencv/core/Core
body: <p>I have been working with OpenCV for quite a long time. But this is my first time using with java in eclipse. I followed this <a href="https://opencv-java-tutorials.readthedocs.io/en/latest/01-installing-opencv-for-java.html" rel="nofollow noreferrer">tutorial</a></p>
  
  <p>To import <code>OpenCV 4.1.0</code> in eclipse. I even search a lot of websites and they have the exact same steps. Every time I run the code I will get this **error*</p>
  
  <pre><code>    Exception in thread "main" java.lang.NoClassDefFoundError: org/opencv/core/Core
          at abss123.Openc_importing.main(Openc_importing.java:18)
      Caused by: java.lang.ClassNotFoundException: org.opencv.core.Core
          at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
          at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
          at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
          ... 1 more
  </code></pre>
  
  <p>Some people were talking about changing the POM file or something but I didn't really understand. I found the POM file in the source file in opencv but not in the build which means need to build from source. I tried to load the <code>"opencv_java410.dll"</code> using <code>System.load(...)</code> command still didn't work  </p>
  
  <p><strong>I also tried</strong> to add the Lib folder and the bin folder to my windows environment. But still, none of it worked. I will post my code and some command was commented to indicate that I tried it. I hope you can help me coz I'm stuck in this problem since yesterday.  </p>
  
  <pre><code>package abss123;
  import org.opencv.imgproc.Imgproc;
  import org.opencv.video.*;
  import org.opencv.core.Core;
  import org.opencv.core.Mat;
  import org.opencv.core.CvType;
  import org.opencv.imgcodecs.*;
  import org.opencv.highgui.HighGui;
  import java.io.*;
  
  public class Openc_importing {
  
          public static void main(String args[]) {
          //LoadOpencv() ; 
          //nu.pattern.OpenCV.loadShared();
          System.loadLibrary(Core.NATIVE_LIBRARY_NAME); 
          Mat image = new Mat(); 
          image = Imgcodecs.imread("MYPT000001.jpg"); 
          HighGui.imshow("First time", image);
  
      }
  
      static void LoadOpencv() {      
          System.load("C:\\opencv\\build\\java\\x64\\opencv_java410.dll");
      }
  }
  </code></pre>