title: Very basic running of drools 5, basic setup and quickstart
body: <p>Is there a more comprehensive quick start for drools 5.  I was attempting to run the simple Hello World .drl rule but I wanted to do it through an ant script, possibly with just javac/java:</p>
  
  <p>I get the following error:  Note: I don't am running completely without Eclipse or any other IDE:  </p>
  
  <p>Is there a more comprehensive quick start for drools 5.  I was attempting to run the simple Hello World .drl rule but I wanted to do it through an ant script, possibly with just javac/java:</p>
  
  <p>I get the following error:  Note: I don't am running completely without Eclipse or any other IDE: </p>
  
  <pre><code>test:
       [java] Exception in thread "main" org.drools.RuntimeDroolsException: Unable to load d
  ialect 'org.drools.rule.builder.dialect.java.JavaDialectConfiguration:java:org.drools.rule
  .builder.dialect.java.JavaDialectConfiguration'
       [java]     at org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuild
  erConfiguration.java:274)
       [java]     at org.drools.compiler.PackageBuilderConfiguration.buildDialectConfigurati
  onMap(PackageBuilderConfiguration.java:259)
       [java]     at org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConf
  iguration.java:176)
       [java]     at org.drools.compiler.PackageBuilderConfiguration.&lt;init&gt;(PackageBuilderCo
  nfiguration.java:153)
       [java]     at org.drools.compiler.PackageBuilder.&lt;init&gt;(PackageBuilder.java:242)
       [java]     at org.drools.compiler.PackageBuilder.&lt;init&gt;(PackageBuilder.java:142)
       [java]     at org.drools.builder.impl.KnowledgeBuilderProviderImpl.newKnowledgeBuilde
  r(KnowledgeBuilderProviderImpl.java:29)
       [java]     at org.drools.builder.KnowledgeBuilderFactory.newKnowledgeBuilder(Knowledg
  eBuilderFactory.java:29)
       [java]     at org.berlin.rpg.rules.Rules.rules(Rules.java:33)
       [java]     at org.berlin.rpg.rules.Rules.main(Rules.java:73)
       [java] Caused by: java.lang.RuntimeException: The Eclipse JDT Core jar is not in the
  classpath
       [java]     at org.drools.rule.builder.dialect.java.JavaDialectConfiguration.setCompil
  er(JavaDialectConfiguration.java:94)
       [java]     at org.drools.rule.builder.dialect.java.JavaDialectConfiguration.init(Java
  DialectConfiguration.java:55)
       [java]     at org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuild
  erConfiguration.java:270)
       [java]     ... 9 more
       [java] Java Result: 1
  
  ...
  ...
  </code></pre>
  
  <p>I do include the following libraries with my javac and java target:</p>
  
  <pre><code> &lt;path id="classpath"&gt;
       &lt;pathelement location="${lib.dir}" /&gt;
       &lt;pathelement location="${lib.dir}/drools-api-5.0.1.jar" /&gt;
       &lt;pathelement location="${lib.dir}/drools-compiler-5.0.1.jar" /&gt;
       &lt;pathelement location="${lib.dir}/drools-core-5.0.1.jar" /&gt;
       &lt;pathelement location="${lib.dir}/janino-2.5.15.jar" /&gt;
   &lt;/path&gt;
  </code></pre>
  
  <p>Here is the Java code that is throwing the error.  I commented out the java.compiler code, that didn't work either.</p>
  
  <p>public void rules() {</p>
  
  <pre><code>/*
  final Properties properties = new Properties(); 
  properties.setProperty( "drools.dialect.java.compiler", "JANINO" ); 
  PackageBuilderConfiguration cfg = new PackageBuilderConfiguration( properties ); 
  JavaDialectConfiguration javaConf = (JavaDialectConfiguration) 
  cfg.getDialectConfiguration( "java" ); 
  */
  final KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
  
  // this will parse and compile in one step
  kbuilder.add(ResourceFactory.newClassPathResource("HelloWorld.drl", Rules.class), ResourceType.DRL);
  
  // Check the builder for errors
  if (kbuilder.hasErrors()) {
      System.out.println(kbuilder.getErrors().toString());
      throw new RuntimeException("Unable to compile \"HelloWorld.drl\".");
  }
  
  // Get the compiled packages (which are serializable)
  final Collection&lt;KnowledgePackage&gt; pkgs = kbuilder.getKnowledgePackages();
  
  // Add the packages to a knowledgebase (deploy the knowledge packages).
  final KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
  kbase.addKnowledgePackages(pkgs);
  
  final StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
  ksession.setGlobal("list", new ArrayList&lt;Object&gt;());
  
  ksession.addEventListener(new DebugAgendaEventListener());
  ksession.addEventListener(new DebugWorkingMemoryEventListener());
  
  // Setup the audit logging
  KnowledgeRuntimeLogger logger = KnowledgeRuntimeLoggerFactory.newFileLogger(ksession, "log/helloworld");
  
  final Message message = new Message();
  message.setMessage("Hello World");
  message.setStatus(Message.HELLO);
  ksession.insert(message);
  
  ksession.fireAllRules();
  logger.close();
  ksession.dispose();
  </code></pre>
  
  <p>}</p>
  
  <p>...</p>
  
  <p>Here I don't think Ant is relevant because I have fork set to true:</p>
  
  <pre><code> &lt;target name="test" depends="compile"&gt;
       &lt;java classname="org.berlin.rpg.rules.Rules" fork="true"&gt;
           &lt;classpath refid="classpath.rt" /&gt;
           &lt;classpath&gt;
               &lt;pathelement location="${basedir}" /&gt;
               &lt;pathelement location="${build.classes.dir}" /&gt;
           &lt;/classpath&gt;
       &lt;/java&gt;
   &lt;/target&gt;
  </code></pre>
  
  <p>The error is thrown at line 1.</p>
  
  <p>Basically, I haven't done anything except call</p>
  
  <p>final KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();</p>
  
  <p>I am running with Windows XP, Java6, and within Ant.1.7.
  The most recent (as of yesterday) version 5 of Drools-Rules.</p>