Has anybody managed to run or-tools in IntelliJ? I'm able to compile, build, and run the package plus one of the examples; i.e., this works:
ip-192-168-1-67:or-tools rick$ java -Djava.library.path=/Users/rick/github/or-tools/lib -cp objs:/Users/rick/github/or-tools/lib/com.google.ortools.jar:/Users/rick/github/or-tools/lib/protobuf.jar com.google.ortools.samples.SimpleRoutingTest
cost = 13
However, I cannot run the package in IntelliJ. I've added the ortools jar to my module dependencies as well as added -Djava.libarry.path=blahblahblah to my VM options in my run configuration. This is the code:
RoutingModel routingModel = new RoutingModel(tour.getStops().size(),
NUMBER_OF_ROUTES, NUMBER_OF_DEPOTS);
routingModel.setArcCostEvaluatorOfAllVehicles(new ArcCostEvaluator(tour));
RoutingSearchParameters searchParameters = RoutingSearchParameters.newBuilder()
.mergeFrom(RoutingModel.defaultSearchParameters())
.setFirstSolutionStrategy(FirstSolutionStrategy.Value.PATH_CHEAPEST_ARC)
.build();
Assignment solution = routingModel.solveWithParameters(searchParameters);
and this is the exception:
java.lang.UnsatisfiedLinkError: com.google.ortools.constraintsolver.operations_research_constraint_solverJNI.swig_module_init()V at com.google.ortools.constraintsolver.operations_research_constraint_solverJNI.swig_module_init(Native Method) at com.google.ortools.constraintsolver.operations_research_constraint_solverJNI.<clinit>(operations_research_constraint_solverJNI.java:2330) at com.google.ortools.constraintsolver.RoutingModel.<clinit>(RoutingModel.java:652) ... Process finished with exit code 255
Any clue?