We have different options to start using JaCaMo: shell script commands, Gradle, Docker, …
The shell script option requires that you download and install JaCaMo in your machine. Since these options do not include an IDE, you can either import the project into an Eclipse/IntelliJ/…. workspace or use some text editor (we suggest VSCode).
GitHub codespace / GitPod
With GitHub codespace or GitPod you can develop your MAS using only a browser.
Requirements:
-
A GitHub account
-
A browser (Chrome and Safari works fine)
Steps for GitPod:
-
click on this link.
-
Run the MAS with the command
./gradlew run
in the terminal.
Steps for codespace:
-
Go the JaCaMo Template Project
-
Click on "use this template" and then "open in a codespace":
-
Run the MAS with the command
./gradlew run
in the terminal.
Gradle
Gradle is a very simple way to develop JaCaMo application in your machine with minimal requirements.
Requirements:
-
Java >= 21
Follow the steps below to create a new application:
Note
|
The first time you run takes longer since it downloads JaCaMo. |
- Unix
-
wget -q http://jacamo-lang.github.io/jacamo/nps/np1.3.zip unzip np1.3.zip ./gradlew --console=plain
- Windows
-
-
Download wget -q http://jacamo-lang.github.io/jacamo/nps/np1.3.zip
-
Unzip
-
Run
gradlew.bat
-
You will be asked to enter the identification of the application and then instructions about how to run it will be shown.
Example of output:
> Task :run Enter the identification of the new application: helloworld Creating path /Users/jomi/tmp/helloworld You can run your application with: cd /Users/jomi/tmp/helloworld ./gradlew -q --console=plain or (if you have JaCaMo CLI installed) jacamo helloworld.jcm
If you want to run a JaCaMo application that was not created with a build.gradle
file, you can download a template from here and replace
-
<VERSION>
by the required JaCaMo release (e.g.1.0
) -
<PROJECT-FILE>
by your .jcm file (e.g.hello.jcm
).
To edit your code, any text editor can be used. VS Code has plugins for syntax highlight.
JaCaMo Command Line Interface (CLI)
This option requires that you install JaCaMo CLI in your machine. JaCaMo CLI has features to create and manage JaCaMo projects.
- For Debian, Ubuntu, Mint, and derivates (APT Package by Chon)
-
To install execute the following commands in a terminal:
echo "deb [trusted=yes] http://packages.chon.group/ chonos main" | sudo tee /etc/apt/sources.list.d/chonos.list sudo apt update sudo apt install jacamo-cli
- For Windows (Installer by Chon)
-
To install, download the jacamo-installer-file and proceed with the instalation, like below:
- Others
-
Requirements:
-
Java >= 21
-
Download a JaCaMo release from here (download the file named jacamo-bin-…..zip
) and decompress it. The zip file contains documentation, examples, and a sub-directory bin
with the file jacamo
. It is a unix executable file, if not, change its properties with chmod +x jacamo
. Finally, adds the directory bin
in your machine PATH
so that the command jacamo
can be executed in a terminal.
- Hello World
-
In a terminal, you can create a new application named
app1
with the command
jacamo app create app1
and execute it with
cd app1
jacamo app1.jcm
Another usual option is to create an uber jar:
jacamo app create app2 --console
cd app2
jacamo app compile
java -jar build/libs/jacamo-app2-1.0-all.jar
More parameters for the jacamo
command can be found here.
Docker
Requirements:
See JaCaMo-Docker page for instructions on how to create and run JaCaMo application using Docker images.