Linux Java library linking issue?

68 views
Skip to first unread message

Julien Roubieu

unread,
Apr 6, 2017, 8:03:36 PM4/6/17
to or-tools-discuss
Hello everyone,

I'm building from source to be able to use `addDimensionWithVehicleTransits` that was recently added to the Java lib.
I'm having an issue running the lib on Linux. I guess I forgot something in the build process, maybe someone knows what it could be and give me a hint.

Building and running for OSX works perfectly.
Building for Linux on a Debian 8 box completes successfully (`make third_party cc java test_java`).

However my program fails on the call to `System.loadLibrary`, with the following error:

```
Started with java.library.path = /opt/docker/lib
Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/docker/lib/libjniortools.so: libortools.so: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1857)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
```

`libortools.so` is in the lib directory.
If I replace `libjniortools.so` with the one from the latest 5.1 release, the library is loaded without this exception (although it obviously fails later).

Does someone have an idea why the libjniortools I built cannot find libortools?
Reply all
Reply to author
Forward
0 new messages