• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to load .so file using JNA in eclipse  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi i am trying to load .so file through JNA and i got java.lang.UnsatisfiedLinkError: Unable to load library

my sample code is
public class DemoJNA {

private static String osname = System.getProperty("os.name").toLowerCase();

public interface CLibrary extends Library {

}






public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("start searching");
try
{
CLibrary ins = (CLibrary) Native.loadLibrary("cruntimedll", CLibrary.class);
}
catch (UnsatisfiedLinkError e)
{
e.printStackTrace();
System.out.println("not found");
}
}


please help me how to load .so file. using gcc command i create .so file
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!