Click here to Skip to main content
15,609,978 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
hi experts,

I am developing one java application in ubuntu 10.04.

I am trying to load library named "" but below error given

Exception in thread "main" java.lang.UnsatisfiedLinkError: no libTestJavaLib in java.library.path
    at java.lang.ClassLoader.loadLibrary(
    at java.lang.Runtime.loadLibrary0(
    at java.lang.System.loadLibrary(
    at javaapptest.JavaAppTest.<clinit>(

i have try all below path for "libTestJavaLib" file


but it is still error.
how can i solved it?
My sample Code is as under

public class JavaAppTest {
     static long device;
    public static void main(String[] args) {
        device = mfs100.MFS100_Init();
        System.out.println("testing complete");

public class mfs100 {
  public static long MFS100_Init() {
    long cPtr = mfs100javaJNI.MFS100_Init();
    return cPtr;

  public static int MFS100_Close(long device) {
    return mfs100javaJNI.MFS100_Close(device);
public class mfs100javaJNI {
  public final static native long MFS100_Init();
  public final static native int MFS100_Close(long jarg1);

An *.so File is NOT a Java Library and can NOT be used as one.

What is in that SO-File and why do you want to use it?
Share this answer
Have you tried this:

java -Djava.library.path=<path to="" library="">

I took this from here[]
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900