title: Accessing dll methods in java
body: <p>I am trying to accessing dll methods in java which has been written in c#. From the following code i am trying to build dll which is generated successfully.</p>
  
  <pre><code>using System;
  using Microsoft.Win32;
  
  
  namespace CyberoamWinHelper
  {
      public class RegistryAccess
      {        
          public static String getValue(String key)
          {
              RegistryKey rk = Registry.CurrentUser;
              RegistryKey rk1=rk.OpenSubKey("Software\\Test", RegistryKeyPermissionCheck.ReadWriteSubTree, System.Security.AccessControl.RegistryRights.FullControl);
              rk1.SetValue(key, "val1");
              return rk1.GetValue(key).ToString();
          }
          public static void createSubkey(String name)
          {
              RegistryKey rk = Registry.CurrentUser;
              rk.CreateSubKey("Software\\Test");
          }
      }
  }
  </code></pre>
  
  <p>After this i am loading the generated dll in my java program code of which is as follows</p>
  
  <pre><code>public class JNI {
  
      /**
       * @param args the command line arguments
       */
      public native String getValue(String key);    
  
      public static void main(String[] args) {
          // TODO code application logic here
  
          try
          {
              System.loadLibrary("CyberoamWinHelper");
              JNI j=new JNI();       
              System.out.println(j.getValue("abc"));
          }
          catch(UnsatisfiedLinkError  e)
          {
              System.out.println("Ex" + e.getMessage());
          }
      }
  }
  </code></pre>
  
  <p>After running this code it is giving me the following error.</p>
  
  <pre><code>"Exjni.JNI.getValue(Ljava/lang/String;)Ljava/lang/String;"
  </code></pre>
  
  <p>Well i am not understanding what this error is saying but i want to solve it.
  And one more question i am having is since the method i am calling is a static method will it be called in this way? i mean to call static method we need </p>
  
  <blockquote>
    <p>"classname.methodname"</p>
  </blockquote>
  
  <p>so here will it be able to call the method?</p>