Search code examples
javagurobiunsatisfiedlinkerrorjava.library.path

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


I own an academic license for Gurobi. I followed the guide, but ended up with a problem. The steps I went through are:

  1. downloaded the Gurobi .tar.gz
  2. extracted it in the /opt folder with the command tar xvzf gurobi_installer.tar.gz
  3. a folder named "gurobi902" was created in the /opt folder after the extraction
  4. run the command grbgetkey xxxxx xxxxx xxxxxx xxxxxx xxxxx to activate the license
  5. wrote the following lines in the .bashrc and .profile files
export GUROBI_HOME="/opt/gurobi902/linux64"
export PATH="${PATH}:${GUROBI_HOME}/bin"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${GUROBI_HOME}/lib"
  1. opened Eclipse and edited the build path of my project and added the external jar of gurobi.jar

When I run the java program in Eclipse I get the message

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

My system has:

  • Operating System: Manjaro Linux
  • KDE Plasma Version: 5.18.5
  • KDE Frameworks Version: 5.70.0
  • Qt Version: 5.15.0
  • Kernel Version: 4.19.126-1-MANJARO
  • OS Type: 64-bit

How can I solve it? Thanks in advance for the help!


Solution

  • I write what worked for me.

    1. Remove from /opt all the Gurobi installation folders
    2. Reinstall Gurobi with a new license
    3. Set the Path variables correctly, as written in the Gurobi wiki
    4. Relaunch IntelliJ with the default settings (from File -> Launch with default)
    5. (optional) specify again the Path variables in the launch configuration
    6. Run the program

    If it still doesn’t work, run:

    sudo ln -s /opt/gurobi951/linux64/lib/libgurobi95.so /usr/lib
    sudo ln -s /opt/gurobi951/linux64/lib/libGurobiJni95.so /usr/lib
    sudo ldconfig