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,9 +10,9 @@
// 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;
@@ -20,14 +20,8 @@ import com.google.ortools.linearsolver.MPVariable;
/**
* Linear programming example that shows how to use the API.
*
*/
public class LinearProgramming {
static {
System.loadLibrary("jniortools");
}
private static void runLinearProgrammingExample(String solverType, boolean printModel) {
MPSolver solver = MPSolver.createSolver(solverType);
if (solver == null) {
@@ -115,6 +109,7 @@ public class LinearProgramming {
}
public static void main(String[] args) throws Exception {
Loader.loadNativeLibraries();
System.out.println("---- Linear programming example with GLOP (recommended) ----");
runLinearProgrammingExample("GLOP", true);
System.out.println("---- Linear programming example with CLP ----");