2

Good evening, I tried to use the JADE platform (official site -> http://jade.tilab.com/)

I followed tutorials that I found on youtube

Here's the code

import jade.core.Profile;
import jade.core.ProfileImpl;
import jade.core.Runtime;
import jade.util.ExtendedProperties;
import jade.util.leap.Properties;
import jade.wrapper.AgentContainer;
import jade.wrapper.ControllerException;


public class MainContainer {


    public static void main(String[] args) {

        try {
            Runtime rt = Runtime.instance();
            Properties p = new ExtendedProperties();
            p.setProperty(Profile.GUI, "true");
            ProfileImpl pc = new ProfileImpl(p);
            AgentContainer container = rt.createAgentContainer(pc);
            container.start();
        } catch (ControllerException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

    }
}

But when I run the program I get errors like:

Exception in thread "main" java.lang.NoClassDefFoundError: jade/wrapper/ControllerException
****at java.lang.Class.getDeclaredMethods0(Native Method)
****at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
****at java.lang.Class.getMethod0(Unknown Source)
****at java.lang.Class.getMethod(Unknown Source)
****at sun.launcher.LauncherHelper.getMainMethod(Unknown Source)
****at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: jade.wrapper.ControllerException
****at java.net.URLClassLoader$1.run(Unknown Source)
****at java.net.URLClassLoader$1.run(Unknown Source)
****at java.security.AccessController.doPrivileged(Native Method)
****at java.net.URLClassLoader.findClass(Unknown Source)
****at java.lang.ClassLoader.loadClass(Unknown Source)
****at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
****at java.lang.ClassLoader.loadClass(Unknown Source)
****... 6 more

How To fix it please !

PS: I'm on windows7

Mureinik
  • 297,002
  • 52
  • 306
  • 350

1 Answers1

2

You are missing jade's jar from your classpath. You could add it to the -cp parameter of java. E.g.:

java -cp JADE-all-4.3.2.zip MainContainer
Mureinik
  • 297,002
  • 52
  • 306
  • 350