Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7081667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:56:57+00:00 2026-05-28T06:56:57+00:00

I am using Drools Planner which ships with 21 Jar files in a directory

  • 0

I am using Drools Planner which ships with 21 Jar files in a directory binaries. For example the
drools-core-5.3.0.Final.jar would provide org.drools.someClasses.

The included examples run it in command line by running an all-inclusive command:

mainClasspath=
for i in binaries/*.jar; do mainClasspath=${mainClasspath}:$i; done

mainClass=org.drools.planner.examples.app.DroolsPlannerExamplesApp
$JAVA_HOME/bin/java -Xms256m -Xmx512m -server -cp ${mainClasspath} ${mainClass} $*

I am developing the program in commandline. But the final application (which just adds a HTTP interface) runs in a JSP container, not from a commandline. Hence I need to programmatically import the jar files into my project.

Question:How do I programatically import the the jar files?

Do I rather have to specify the binaries path in the environment variable?


Update

I did this to tell Java that globally, extra classes may be found in the same directory, meant by the . and /home/jesvin/dev/drools/binaries. Note that : is the separator in Linux.

declare -x CLASSPATH='.:/home/jesvin/dev/drools/binaries' 

You can do it per execution instance as per Miserable Variable’s answer.

Finally, in a Tomcat deployment, I give it a HTTP interface, deploying it as per havexz’s answer.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:56:58+00:00Added an answer on May 28, 2026 at 6:56 am

    If the jars need to be in global scope:

    Well if you want these jars to be available to all apps on the server try putting them in

    `<tomcat_install_dir>/lib`
    

    EDIT: @Geoffery comment: If you have access to

    <tomcat_install_di>/conf/catalina.properties
    

    then you can added your own common jars dir like:

    common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar,${catalina.base}/your_common_jar_folder/*.jar

    (See carefully at the end, I had added a new folder)

    But either way, if the jars meant to be at global scope they should be in any of above folders. Else you have to put other common jars for logging and jdbc etc with every app.

    If the jars need to be in app scope

    And if you want these jars to be used only one specific app then put them in

    `<your_web_app>/WEB-INF/lib`
    

    Note: You can put the <your_web_app>/WEB-INF/lib of your development folder and if you are using the right tools then it will make these jars part of your .war file.

    SIDE NOTE: Since you are running java program from command line too and having issues adding dependency jars. Sometime back I wrote a shell script for this purpose, hope this will help you too.

    Small snippet of it:

    Run Java easily from shell command
    
    Usage: easyrunjava [-c <jar_name/jar_dir>,<jar_name/jar_dir>...] [-m <email_id1>,<email_id2>...] [-p <prop_file1>,<prop_file2>...] class_name [args_to_program]
    
    Example:
    `easyrunjava -p .,./dependency -m user.name@xyz.com com.example.HelloWorld`
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Drools Planner which takes configuration by XML. The configure method is
I'm using drools-planner-5.4.0.CR1 and I wanna get list of broken constraints for final best
I'm using Drools 5.4.0.Final For logging I'm using logback in my application. I tried
I have a problem in using Drools Planner (written in Java) in Scala. One
We are using: • Drools Execution Server that came with Drools 5.0.x • Drools
I am facing some issues while serializing objects (I am using JBoss Drools, and
using this http://bl.ocks.org/950642 we can see how to add images to nodes, the question
I have been working on my first Java project with the 'Drools Planner' package,
The purpose of this quetion is to evaluate the reasonability of using Drools for
I am using Eclipse with the Drools plugin to create rules. I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.