Is it possible to install the library on IntelliJ Idea?
or do I have to use Visual Studio 2017?
If so, how do I install it? I find the google documentation conf
In case anyone else comes here, this is my configuration for building and running OR-tools with Gradle.
First of all, I have a top-level project where I have application-related code, called suite, and a module where I have separated all the OR-Tools related code, called optimization. In the optimization module, I have a folder lib which contains the following files (not sure if you need all of them):
com.google.ortools.jar
libcvrptw_lib.so
libdimacs.so
libjniortools.so
libortools.so
As you can see, there's no protobuf.jar here -this comes later. Then I added the following to my existing top-level build.gradle file:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.6'
}
...
}
apply plugin: 'application'
applicationDefaultJvmArgs = ["-Djava.library.path=optimization/lib"]
mainClassName = 'com.package.name.MainClass'
Note that for applicationDefaultJvmArgs you have to change the path to your lib folder. And of course, update mainClassName to your main class.
And finally, in the build.gradle of my optimization module I added the following dependencies:
dependencies {
compile files('lib/com.google.ortools.jar')
compile 'com.google.protobuf:protobuf-java:3.0.0'
...
}
The above compiles ortools.jar from the lib folder and downloads the protobuf-java library from mavenCentral.
PS. Don't forget to load the jniortools library in your Java class that accesses OR-tools:
static {
System.loadLibrary("jniortools");
}
Obviously, you don't need sub-modules to make this work - this is just my implementation. Hope this helps.