I've developed a Multi Agent System application with the Jason agent platform which also uses the Jade agent framework for its infrastructure. The project works fine with Eclipse. However, I want to create a jar file of the project but since it's not a Java application, it does not have a main class. At Jason's FAQ Web Page, they've given three options for "How to run my application without JasonIDE" with the third option being the one for creating the jar file:
cd <the directory of you application>
ant -f bin/build.xml jar
java -jar <your application>.jar
I've gone through the first two steps and the jar file is created successfully. But when I try to run the jar file as stated at the third step, I get the message "Storing configuration C:\Users\Ali.jason\user.properties" at the console and the "Jason Configuration" window pops up.
I've read a lot about creating jar files, but they are all for Java applications with main classes. The closer I got for a Jason application (the only one) was here at another StackOverflow question which has a problem about the second step of the same code. I've updated my build.xml file according to it, to contain the "Main-Class" info, with the difference being:
<manifest>
<attribute name="Main-Class" value="jason.infra.jade.RunJadeMAS"/>
</manifest>
which is my case with the Jade infrastructure, instead of the centralised infrastructure there:
<manifest>
<attribute name="Main-Class" value="jason.infra.centralised.RunCentralisedMAS"/>
</manifest>
This time, the jar file is created successfully again, but when I try to run it, I got the following message at the console:
Exception in thread "main" java.lang.NoClassDefFoundError: jade/core/ProfileImpl ....... Caused by: java.lang.ClassNotFoundException: jade.core.ProfileImpl
"jade.core.ProfileImpl" is not stated at the build.xml file explicitly and I already have the jade library at the build.xml file:
<pathelement location="C:\Users\Ali\Desktop\Project\jade\lib\jade.jar"/>
"jade.jar" is also already in the system path and classpath. I've searched for this problem, but could not find anything. Do you have any suggestions?