Google OR-Tools for Java

A project to publish Google OR-Tools as a dependable dependency in Maven.

License

License

GroupId

GroupId

io.github.oliviercailloux
ArtifactId

ArtifactId

google-or-tools
Last Version

Last Version

6.7.2
Release Date

Release Date

Type

Type

jar
Description

Description

Google OR-Tools for Java
A project to publish Google OR-Tools as a dependable dependency in Maven.
Project URL

Project URL

http://github.com/oliviercailloux/google-or-tools-java
Source Code Management

Source Code Management

http://github.com/oliviercailloux/google-or-tools-java

Download google-or-tools

How to add to project

<!-- https://jarcasting.com/artifacts/io.github.oliviercailloux/google-or-tools/ -->
<dependency>
    <groupId>io.github.oliviercailloux</groupId>
    <artifactId>google-or-tools</artifactId>
    <version>6.7.2</version>
</dependency>
// https://jarcasting.com/artifacts/io.github.oliviercailloux/google-or-tools/
implementation 'io.github.oliviercailloux:google-or-tools:6.7.2'
// https://jarcasting.com/artifacts/io.github.oliviercailloux/google-or-tools/
implementation ("io.github.oliviercailloux:google-or-tools:6.7.2")
'io.github.oliviercailloux:google-or-tools:jar:6.7.2'
<dependency org="io.github.oliviercailloux" name="google-or-tools" rev="6.7.2">
  <artifact name="google-or-tools" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.github.oliviercailloux', module='google-or-tools', version='6.7.2')
)
libraryDependencies += "io.github.oliviercailloux" % "google-or-tools" % "6.7.2"
[io.github.oliviercailloux/google-or-tools "6.7.2"]

Dependencies

compile (1)

Group / Artifact Type Version
com.google.protobuf : protobuf-java jar 3.6.0

test (3)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.7.25
ch.qos.logback : logback-classic Optional jar 1.2.3
org.junit.jupiter : junit-jupiter-api jar 5.2.0

Project Modules

There are no modules declared in this project.

Google OR-Tools for Java

Build Status Artifact on Maven Central

A project to publish Google OR-Tools as a dependable dependency in Maven.

This project contains no specific source code (except for a simple test class). Everything comes from Google OR-Tools.

Depending on Google OR-Tools

Here is how to use this project as a dependency in your own project.

  • Add this project as a dependency (find its Maven coordinates using the badge above) of your project

  • To configure your library path correctly for tests, configure maven-surefire-plugin, see this pom as an example

  • Copy the lib folder of this project into your own project (for linux, hoping that it will work), or replace its content with libraries appropriate for your OS: check inside the lib folder of the release version corresponding to your OS

  • Copy the test class from this project into your own project

  • Run the unit test using Maven: it should load the native library, run the solver, and come out green

  • To configure Eclipse so that it finds the native library, in the project properties, Java Build Path, Source tab, google-or-tools/src/test/java, Native library location, specify as Location path: google-or-tools/lib (for other IDEs, adapt accordingly)

  • Run io.github.oliviercailloux.google_or_tools.TestRun as JUnit test from your IDE, it should pass

The above configures your library path correctly only for running tests. You will probably want to make sure that your library path is set correctly for normal operation as well. Multiple manners exist, depending on your particular needs, how you want to distribute your project, …

About more recent versions

For reasons of time, I do not intend to keep this library systematically up-to-date. In other words, the version published here is older than the last version of Google OR-Tools, on which the developer site is based. See also this issue.

Please do not ask for updates: I will update only as my own projects require (meaning, rarely, if ever). Please rather add your voice – or thumb – here in hope that the main developers publish the library to Maven Central themselves. In the meantime, you can also fork this repository and update it under your own groupId: given the instructions below, it might (hopefully?) be easy.

Making Google OR-Tools for Java

Here is how to re-make this project from scratch (except for the test class and pom.xml, which I created manually).

  • install prerequisites

  • set ${dest} variable

  • clone OR-Tools in a folder whose full path contain no space

  • git checkout v6.7.2

  • make third_party

  • make java

  • mv "ortools/gen/com" "${dest}/src/main/java/"

  • rmdir "${dest}/src/main/java/com/google/ortools/flatzinc" "${dest}/src/main/java/com/google/ortools/properties" "${dest}/src/main/java/com/google/ortools/sat"

  • Download the library for Ubuntu 14 (this version seems to runs both on Travis and on my Debian system, probably out of pure luck)

  • Extract the archive, move or-tools_Ubuntu-14.04-64bit_v6.7.4981/lib/libortools.so and libjniortools.so to "${dest}/lib/"

Versions

Version
6.7.2