make(java): Migrate samples to maven (#202)
- Factorise makefile code using advanced make function - Use the Loader in samples
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
// [START program]
|
||||
package com.google.ortools.linearsolver.samples;
|
||||
// [START import]
|
||||
import com.google.ortools.Loader;
|
||||
import com.google.ortools.linearsolver.MPConstraint;
|
||||
import com.google.ortools.linearsolver.MPObjective;
|
||||
import com.google.ortools.linearsolver.MPSolver;
|
||||
@@ -23,11 +24,8 @@ import com.google.ortools.linearsolver.MPVariable;
|
||||
|
||||
/** Minimal Mixed Integer Programming example to showcase calling the solver. */
|
||||
public class SimpleMipProgram {
|
||||
static {
|
||||
System.loadLibrary("jniortools");
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
Loader.loadNativeLibraries();
|
||||
// [START solver]
|
||||
// Create the linear solver with the SCIP backend.
|
||||
MPSolver solver = MPSolver.createSolver("SCIP");
|
||||
|
||||
Reference in New Issue
Block a user