I'm using Docker with the https://hub.docker.com/r/bitnami/java image. I've got my jar file aa.jar and it uses Gurobi.
I'm setting the environment variables so that Gurobi can be found.
GUROBI_HOME=/code/gurobi811/linux64
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${GUROBI_HOME}/lib
GRB_LICENSE_FILE=/code/gurobi.lic
PATH=${PATH}:/opt/bitnami/java/bin:/opt/bitnami/java/lib:/opt/bitnami/java:/bin:/usr/bin/:/code/gurobi811/linux64/bin:/code/bin
JAVA_HOME=/opt/bitnami/java
When I run the code I also include gurobi.jar in the classpath
java -cp gurobi.jar -jar aa.jar evaluate
This is working to an extent. When I don't include the classpath I get the error Exception in thread "main" java.lang.NoClassDefFoundError: gurobi/GRBException
. The exception is the first mention of Gurobi in the code. When I include it I get
Exception in thread "main" java.lang.NoClassDefFoundError: gurobi/GRBExpr
java_1 | at Alg.evaluate.main(evaluate.java:44)
java_1 | Caused by: java.lang.ClassNotFoundException: gurobi.GRBExpr
I'm not sure why this isn't working as all the files should be included in the jar being included by the -cp parameter.
Also I'm only on the Gurobi academic license, so I can't go to the official Gurobi support.