1.3. Run the Examples
Procedure 1.2. 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.
- 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)
- Run that run configuration.
Procedure 1.3. Use Business Resource Planner with Maven, Gradle, Ivy, Buildr or ANT:
- Get the Business Resource Planner jars at the central maven repository (and also at the JBoss maven 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 maven repository. This is similar for Gradle, Ivy, and Buildr. - If you're still using ANT (without Ivy), copy all the jars from the download zip's
binariesdirectory and manually verify that your classpath doesn't contain duplicate jars.
binaries directory contains far more jars then optaplanner-core actually uses. It also contains the jars used by other modules, such as optaplanner-benchmark.
pom.xml files to determine the minimal dependency set for a specific version of a specific module.
Procedure 1.4. Build Business Resource Planner from source:
$ git clone git@github.com:droolsjbpm/optaplanner.git optaplanner ...
- Do a Maven 3 build:
$ cd optaplanner $ mvn -DskipTests clean install ...
- Run this command to run any example directly from the command line:
$ cd optaplanner-examples $ mvn exec:exec ...

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.