title: Cplex Java add expr(sum) to objective function
body: <p>I've got the following objective function:</p>
  
  <p>minimize sum (trueck[k] - time[k]) for all k (1..n).</p>
  
  <p>I tried to set it up like this:</p>
  
  <pre><code>IloLinearNumExpr obj = cplex.linearNumExpr();
  
  for(int k=0; k&lt;grossK.length; k++){
      obj.addTerm(1.0, cplex.sum(trueck[k], cplex.negative(time[k])));
  }
  
  cplex.addMinimize(obj);
  </code></pre>
  
  <p>The eclipse error message for the 4th line is: </p>
  
  <p>"The method addTerm(double, IloNumVar) in the type IloLinearNumExpr is not applicable for the arguments (double, IloNumExpr)"</p>
  
  <p>I guess the method "addTerm" is wrong but I can't find a solution. 
  Thanks in advance.</p>