title: Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/jna/Pointer
body: <p>I am trying to use tess4j into my java program.
  Here is my code: </p>
  
  <pre><code>`import java.io.File; 
  import net.sourceforge.tess4j.Tesseract; 
  import net.sourceforge.tess4j.TesseractException; 
  
  class Test { 
      public static void main(String[] args) 
      { 
          Tesseract tesseract = new Tesseract(); 
          try { 
  
              String text = tesseract.doOCR(new File("captcha.jpg")); 
  
              System.out.print(text); 
          } 
          catch (TesseractException e) { 
              e.printStackTrace(); 
          } 
      } 
  }
  </code></pre>
  
  <p>I am getting these error messages</p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/jna/Pointer
          at Test.main(Detection.java:9)
  Caused by: java.lang.ClassNotFoundException: com.sun.jna.Pointer
          at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
          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>My folder looks like this:</p>
  
  <p>Main folder:</p>
  
  <ol>
  <li><p>Detection.java</p></li>
  <li><p>lib -> Here I have the "tess4j-3.4.8.jar" file I got after downloading the tess4j and going into the dist folder</p></li>
  <li><p><code>.captcha.jpg</code></p></li>
  </ol>
  
  <p>I am not able to solve this issue. Please help.</p>
  
  <p>I am using visual studio code as my IDE.</p>