java.lang.UnsatisfiedLinkError: no GurobiJni81 in java.library.path

478 views
Skip to first unread message

Djordje Bajic

unread,
Jan 4, 2019, 3:35:15 PM1/4/19
to Gurobi Optimization
Hi,

I am struggling to find a solution to this problem despite having addressed the possible solutions found in several similar questions online. Does anybody have a clue why this might be happening?

I have a fresh gurobi installation (v 8.1) located in the recomended folder in linux (/opt) which I am trying to use with Java. These are my environment variables (copied from .bashrc):

export GUROBI_HOME=/opt/gurobi810/linux64
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/gurobi810/linux64/bin:/usr/lib/jvm/java-8-openjdk-amd64/bin/
export LD_LIBRARY_PATH=/opt/gurobi810/linux64/lib:/opt/gurobi810/linux64/bin:/usr/lib64/:/usr/share:/usr/share/java:/usr/local/lib:/opt/colt/lib:opt/commons-lang3-3.7
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export CLASSPATH=/opt/gurobi810/linux64/lib:/opt/gurobi810/linux64/bin:/opt/colt/lib/colt.jar:/opt/colt/lib/concurrent.jar:/opt/commons-lang3-3.4
export GRB_LICENSE_FILE=/home/djordje/gurobi.lic

I get the error from the subject both when trying to run the examples (going to /opt/gurobi810/linux64/examples/build and running make run_java) and when trying to run some of my code from within eclipse, with all the libraries properly set up (apparently).

does anybody have any idea about what might be going on?

Dan Jeffrey

unread,
Jan 4, 2019, 4:03:03 PM1/4/19
to Gurobi Optimization
The cause is realted to LD_LIBRARY_PATH.

The environment settings you have given are correct.

1. Change permissions on the build folder so you do not have to be su to compile them without changing the Makefile.
2. Work on one sample at a time to isolate the issue. I like to use the Diet sample:
   make Diet
3. Check to make sure gurobi.jar is in the ${GUROBI_HOME}/lib folder.
4. Check the command issued by the Makefile for compiling the sample(s)
Reply all
Reply to author
Forward
0 new messages