1.3. Run the Examples
Procedure: To run the examples in your favorite IDE:
Configure your IDE:
-
In IntelliJ and NetBeans, just open the file
examples/sources/pom.xmlas a new project, the Maven integration will take care of the rest. -
In Eclipse, open a new project for the directory
examples/sources. -
Add all the JARs to the classpath from the directory
binariesand the directoryexamples/binaries, except for the fileexamples/binaries/optaplanner-examples-*.jar. -
Add the Java source directory
src/main/javaand the Java resources directorysrc/main/resources.
-
In IntelliJ and NetBeans, just open the file
Next, create a run configuration:
-
Main class:
org.optaplanner.examples.app.OptaPlannerExamplesApp -
VM parameters (optional):
-Xmx512M -server -
Working directory:
examples(this is the directory that contains the directorydata)
-
Main class:
- Run that run configuration.
Procedure: Use Business Resource Planner with Maven, Gradle, Ivy, Buildr or Ant:
- Get the Business Resource Planner JARs at the Central Repository (and also at the JBoss Nexus Repository).
If you use Maven, add a dependency to
optaplanner-corein your project’spom.xml:<dependency> <groupId>org.optaplanner</groupId> <artifactId>optaplanner-core</artifactId> <version>...</version> </dependency>To identify the latest version, check the Central Repository. This is similar for Gradle, Ivy, and Buildr.
-
If you’re still using Ant (without Ivy), copy all the JARs from the downloaded ZIP’s
binariesdirectory and manually verify that your classpath doesn’t contain duplicate JARs.
The downloaded ZIP’s binaries directory contains far more JARs then optaplanner-core actually uses. It also contains the JARs used by other modules, such as optaplanner-benchmark.
Check the Maven repository pom.xml files to determine the minimal dependency set for a specific version of a specific module.
Business Resource Planner will be known as Planner for the rest of this book.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.