java.lang.NoClassDefFoundError: org/drool/RuleBase

Hi

I抦 currently working on a program which uses a rule based expert system. I am using eclipse with the expert system shell drools (3.0).

The program works fine when I run it in eclipse but when I try to export the program as a jar file it does not seem to work. I did cmd java -jar to find out what's going wrong and it gives me the following error messages:

Exception in thread "main" java.lang.NoClassDefFoundError: org/drools/RuleBase

at com.sample.GUI.<init>(GUI.java:34)

at com.sample.GUI.main(GUI.java:41)

and also:

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/drool

s/RuleBase

at com.sample.beakAndBill.actionPerformed(beakAndBill.java:64)

at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)

at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)

at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)

at javax.swing.JToggleButton$ToggleButtonModel.setPressed(Unknown Source

)

at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour

ce)

at java.awt.Component.processMouseEvent(Unknown Source)

at javax.swing.JComponent.processMouseEvent(Unknown Source)

at java.awt.Component.processEvent(Unknown Source)

at java.awt.Container.processEvent(Unknown Source)

at java.awt.Component.dispatchEventImpl(Unknown Source)

at java.awt.Container.dispatchEventImpl(Unknown Source)

at java.awt.Component.dispatchEvent(Unknown Source)

at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)

at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)

at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)

at java.awt.Container.dispatchEventImpl(Unknown Source)

at java.awt.Window.dispatchEventImpl(Unknown Source)

at java.awt.Component.dispatchEvent(Unknown Source)

at java.awt.EventQueue.dispatchEvent(Unknown Source)

at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.run(Unknown Source)

can anyone help me with this problem. I know that it抯 probably missing the drools classes and if that is the case can anyone tell me how to add the classes.

Thanks in advance.

[2631 byte] By [mike20043a] at [2007-11-26 15:49:48]
# 1
you need to add the drools classes to the classpath. Assuming they are in drools.jar, and the jar file is in the same directory as your jar[code]java -cp .;drools.jar -jar <yourjarfile.jar>[code]
SomeoneElsea at 2007-7-8 22:09:28 > top of Java-index,Java Essentials,New To Java...
# 2
Or add a Class Path entry to your executable JAR manifest.%
duffymoa at 2007-7-8 22:09:28 > top of Java-index,Java Essentials,New To Java...
# 3
Yeah, what duffy said.;)~Tim
SomeoneElsea at 2007-7-8 22:09:28 > top of Java-index,Java Essentials,New To Java...