title: How to call into .NET dll from Java
body: <p>I have this code to create a simple .NET <code>.dll</code>. It only returns an <code>int</code>.</p>
  
  <p>But, it is not working inside Java.</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  
  namespace ReturnINT
  {
      public class ReturnINT
      {
  
          public static int RetornaInteiro ()
          {
              try
              {
                  int number = 2;
  
                  return number;
              }
              catch (Exception)
              {
                  return 1;
              }
          }
      }
  }
  </code></pre>
  
  <p>How can I call the method from within Java?</p>
  
  <p><strong>When I Use JNI i have this error IN java:</strong></p>
  
  <pre><code>Exception in thread "main" java.lang.UnsatisfiedLinkError: Dll.RetornaInteiro()V
        at Dll.RetornaInteiro(Native Method)
        at Dll.main(Dll.java:27)
  </code></pre>