Creating KAR files
This page will describe how to create KAR files from both the Kepler desktop application and also by using the java jar utilities.
Using Kepler Development Tree
If you are working with the HEAD development tree checked out of SVN from https://code.kepler-project.org/code/kepler/trunk/ then you can use the resources/kar folder of your module to have a KAR created at Kepler runtime. To do this create a folder in the resources/kar folder that has the name that you want to use for the KAR. For example, the AbsoluteValue kar file that is used in the Actors module can be seen here https://code.kepler-project.org/code/kepler/trunk/modules/actors/resources/kar/AbsoluteValue/At runtime these folders are bundled into KAR files and placed into the local repositories in the KeplerData directory. By default the AbsoluteValue actor KAR that is generated on Kepler startup is found here KeplerData/modules/actors/kar/AbsoluteValue.kar
The most common problem when creating a new KAR is having LSID conflicts or improperly formatted MANIFEST.MF files. Make sure you adhere closely to the KAR Manifest Specification and understand KeplerLSIDs. Also, keep in mind that the manifest files must be well formed to the JAR Manifest standard, more info on JAR Manifests here.
Using the Java jar utility
Example:
In this example we will create a KAR file that contains three Actors. The Constant actor, the Display actor, and the AbsoluteValue actor. The AbsoluteValue actor will be inside of a subdirectory named Math.
Directory Structure:
MultiTest/ Constant.xml Display.xml MANIFEST.MF Math/ AbsoluteValue.xml
MANIFEST.MF
Manifest-Version: 1.4.2 KAR-Version: 2.0 lsid: urn:lsid:kepler-project.org:karexample:1:1 Name: Constant.xml lsid: urn:lsid:kepler-project.org:actor:1:1 type: ptolemy.kernel.ComponentEntity handler: org.kepler.kar.handlers.ActorMetadataKAREntryHandler Name: Display.xml lsid: urn:lsid:kepler-project.org:actor:7:1 type: ptolemy.kernel.ComponentEntity handler: org.kepler.kar.handlers.ActorMetadataKAREntryHandler Name: Math/AbsoluteValue.xml lsid: urn:lsid:kepler-project.org:actor:68:1 type: ptolemy.kernel.ComponentEntity handler: org.kepler.kar.handlers.ActorMetadataKAREntryHandler
Jar Command: executed from within the MultiTest directory
jar -cvfm MultiTest.kar MANIFEST.MF Constant.xml Display.xml Math/AbsoluteValue.xml