Creating the environment

The first executable statement in our example obtains a Gurobi environment (using theGRBEnv()constructor):


// Create empty environment, set options, and start GRBEnv env = new GRBEnv(true); env.set("logFile", "mip1.log"); env.start();

In this call we requested anemptyenvironment, chose a log file, and started the environment.

Later calls to create an optimization model will always require an environment, so environment creation is typically the first step in a Gurobi application.