java.lang.UnsatisfiedLinkError
Article ID: C01032
Last updated: 2004/07/19
|
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);
}
}
Solution (UNIX and other platforms)
Locate the libcb directory. This directory should contain one or more
shared libaries. Each of these shared libraries represents an index file format
(FoxPro, dBASE, Clipper). Select the shared library that corresponds to your
preferred index format. Rename that shared library to libcb.so (or
libcb.sl on some UNIX systems, and cb on Macintosh) and place it
in the library path. To determine your library path, you can run the above
piece of code.
If the first solution does not resolve the exception error, you may need to
rebuild the CodeBase native library. Platform-specific instructions on
building the shared native library are included in the documentation installed
with CodeBase for the Java Programming Language. After you have rebuilt the library, place it in the
library path according to the directions in the previous paragraph.
Solution (using -Xbootclasspath)
Set the property sun.boot.library.path so that it includes the
directory where the CodeBase native library is. For example, if the native
library cb.dll is located in your C:\WINNT\SYSTEM32 directory, then you
would run Java with the -D option to set the sun.boot.library.path
property to that directory:
java -Dsun.boot.library.path=c:\winnt\system32 ...
|