make(java): Update examples to use maven (#202)

* Fix RandomTsp.java
This commit is contained in:
Mizux Seiha
2020-09-11 21:17:23 +02:00
parent c6420ba8e6
commit 03ab0457f3
52 changed files with 160 additions and 330 deletions

View File

@@ -10,24 +10,16 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.ortools.java;
package com.google.ortools.examples;
import com.google.ortools.Loader;
import com.google.ortools.linearsolver.MPConstraint;
import com.google.ortools.linearsolver.MPObjective;
import com.google.ortools.linearsolver.MPSolver;
import com.google.ortools.linearsolver.MPVariable;
/**
* Integer programming example that shows how to use the API.
*
*/
/** Integer programming example that shows how to use the API. */
public class IntegerProgramming {
static {
System.loadLibrary("jniortools");
}
private static void runIntegerProgrammingExample(String solverType) {
MPSolver solver = MPSolver.createSolver(solverType);
if (solver == null) {
@@ -79,6 +71,7 @@ public class IntegerProgramming {
}
public static void main(String[] args) throws Exception {
Loader.loadNativeLibraries();
System.out.println("---- Integer programming example with SCIP (recommended) ----");
runIntegerProgrammingExample("SCIP");
System.out.println("---- Integer programming example with CBC ----");