There are several things here, and I'm not really proficient with Java / Native binding. Take what I will say with a grain of salt.
Native library loading works with PATH to find files (java.library.path property), not with CLASSPATH. You should try to export your native library path in PATH before launching Wisdom, and try to System.loadLibrary('jacob-1.18-x64").
If this fail, you will have to build promatically the path to your library.
I think the first thing to know is where is located the native library relatively to your application.
- Will it be embedded in your jar ?
- Located in the filesystem relative to your application launch path ?
- Elsewhere in the system ?
I tend to prefer to package the native library inside the jar as it ensures it will be deployed with the application and ready to use without configuration on the host system. But it complexify the loading because you have to extract the library from the jar before using it.
I think a hardcoded path is a first step, once it will work you could seek to embed it in your jar.
| try { |
| System.loadLibrary("jacob-1.18-x64");// |
|
|
| } catch (final UnsatisfiedLinkError ule) { |
|
|
|
|
|
|
| this.libraryPath = "/path/to/native/"; |
|
|
| addLibraryPath(libraryPath.getParent()); |
| System.loadLibrary("jacob-1.18-x64"); |
|
|
|
|
| } |
| } |
The first loadLibrary will work if the path to your library is in PATH, if not it will force your path into PATH and retry to loadLibrary.
Hope this help!