Search code examples
java-native-interfaceruntime-error

Running JNI program in ubuntu


I am running my first program in ubuntu.

But there was an error when I tried to run it:

  Exception in thread "main" java.lang.UnsatisfiedLinkError: no foo in  java.library.path
  at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1681)
  at java.lang.Runtime.loadLibrary0(Runtime.java:840)
  at java.lang.System.loadLibrary(System.java:1047)
  at JNIFoo.<clinit>(JNIFoo.java:6)
  Could not find the main class: JNIFoo. Program will exit.    

Solution

  • Exception in thread "main" java.lang.UnsatisfiedLinkError: no foo in  java.library.path
    

    Fix your library path and try again.