Reputation: 57
I'm recently using gurobi(java) in eclipse, I'm sure I have successfully got a license and everything was fine when I used gurobi to solve LP problems like that:
public LP(int n, int[]s, int[][]b) throws GRBException
{
...
env = new GRBEnv("LPRelaxation.log");
model = new GRBModel(env);
}
Then I added a QP part to my program and the error occurs:
public QP() throws GRBException
{
env = new GRBEnv("LPRelaxation.log");
model = new GRBModel(env);
}
The error:
Exception in thread "main" gurobi.GRBException: No Gurobi license found (user asus, host OWEN-ASUS, hostid fccf6a77)
at gurobi.GRBEnv.<init>(GRBEnv.java:20)
at methods.QP.<init>(QP.java:16)
....
Upvotes: 3
Views: 5430
Reputation: 29
set the environment variable GRB_LICENSE_FILE with the path to license key file
reference: https://www.gurobi.com/documentation/8.1/quickstart_mac/testing_your_license.html
Upvotes: 2