Installing Google or-tools with gradle project on Windows 10 (Intellij IDEA)

后端 未结 2 1823
感情败类
感情败类 2021-02-09 04:34

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

2条回答
  •  一整个雨季
    2021-02-09 04:57

    We provide prebuilt binaries archives cf https://developers.google.com/optimization/install/java/windows#installing-or-tools so you don't need visual studio to only consume it...

    Then to use it in Gradle you'll need to extract the lib/com.google.ortools.jar, lib/protobuf.jar, the JNI file jniortools.dll which may also depends on the ortools.lib.

    Take a look at the Makefile rule rjava to know the parameters to set and try to add it to your gradle project...

    Something like this:

    javac -d output_dir -cp lib/com.google.ortools.jar;lib/protobuf.jar YourFile.java
    java -Djava.library.path=lib -cp output_dir;lib/com.google.ortools.jar;lib/protobuf.jar YourFile
    

    So you must know how class path and java library path are managed in Gradle....

提交回复
热议问题