Popular Posts

Monday, February 7, 2011

java.lang.UnsatisfiedLinkError


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

at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1413)
at java.lang.Runtime.loadLibrary0(Runtime.java:775)
at java.lang.System.loadLibrary(System.java:835)
at codebase.Code4jni.<init>(Code4jni.java:61)
at test.main(read.java:10)
This exception occurs when creating a new Code4jni object with CodeBase for the Java Programming Language. The exception occurs because the CodeBase native library (DLL on Windows) cannot be found. On UNIX and other systems, it can also be caused by a version difference between the run-time libraries on the system and the run-time libraries associated with with pre-built CodeBase native libraries. In addition, the -Xbootclasspath option will cause this.

Solution (Windows)

Locate the DLL32 folder. This folder should contain one or more DLLs. Each of these DLLs represents an index file format (FoxPro, dBASE, Clipper). Select the DLL that corresponds to your preferred index format. Rename that DLL to cb.dll and place it in your the library path. To determine your library path, you can run this piece of code:
class getLibraryPath
{
   public static void main(String[] args)
   {
      String path = System.getProperty("java.library.path");
      System.out.println(path);
   }
}

No comments:

Post a Comment