I have created a spring application which uses google or-tools. For that, I am importing jniortools using System.loadLibrary("jniortools"). when I provide the .dll file and run the war file it runs perfectly. But when I provide the .so file path in lib, I get the unsatisfiedlinkerror.
Asked
Active
Viewed 960 times
1 Answers
1
Taken from here, a solution for using or-tools over Intellij:
To make it work using Intellij (over a windows machine) you need to:
- Install Microsoft Visual C++ Redistributable for Visual Studio
- Download and extract the OR-Tools library for Java
- In intellij, add jar dependency to the 2 jars under the lib folder of the extracted files (each of the 2 jars separately, do not add to lib folder itself. This is why).
- Add the lib library path to VM options. In Intellij edit your run-configuration and add to vm options:
-Djava.library.path=<path to the lib folder that hold the jars>
Load the jni library statically by adding the below code to your class (as mentioned here.)
static { System.loadLibrary("jniortools"); }

forhas
- 11,551
- 21
- 77
- 111