Usually, it’s convenient to bundle many SARL entity files into a single archive file. This file is named runnable application file (a.k.a. runnable jar file in the Java community). It allows a use to run SARL entities without having to know their names and type them in a command prompt, rather the user can just double click on the runnable application file and the program will fire up. A runnable application file allows SARL entities to be loaded just like when a user clicks an regular executable file.
In this tutorial, we’re going to cover the key points for creating a runnable application file for SARL. Specifically, we’ll take a simple application and explore the ways to package and run it as a runnable file.
Before creating the runnable application file, it is necessary to have a SARL project and its associated run configuration.
For creating a runnable application file, you must create or have a SARL project with a “main program” as it is illustrated in the following figure.
The mandatory element in your program must be the main
function:
static def main(args : String[]) : void {
}
You could find a description of the method for creating your first SARL project.
Once you have implemented your SARL program, you must define a run configuration. This configuration is a feature of the SARL IDE that enables to define a method for launching the program within the SARL Eclipse IDE.
For defining the run configuration, you should follow the steps:
To create a new runnable application file in the workbench:
Copyright © 2014-2024 SARL.io, the Original Authors and Main Authors.
Documentation text and medias are licensed under the Creative Common CC-BY-SA-4.0; you may not use this file except in compliance with CC-BY-SA-4.0. You may obtain a copy of CC-BY-4.0.
Examples of SARL code are licensed under the Apache License, Version 2.0; you may not use this file except in compliance with the Apache License. You may obtain a copy of the Apache License.
You are free to reproduce the content of this page on copyleft websites such as Wikipedia.
Generated with the translator docs.generator 0.14.0.