Deployment of simulations created with EJSYou can distribute the simulations created with EJS using the following options of the “Package” icon,
The exported simulation has some menu options that can be used by your final users to, among other things, extract the model of the simulation and work with it using EJS (if they have EJS installed in their computers). You and your users can also localize a simulation, i.e. have its user interface translated to different languages.
![]()
When you chose the target index file, a check box allows you to create the necessary simulation JAR files either self-contained or minimizing their individual size by creating a separate “common.jar” file that contains repeated library files. The second option is recommended (because it minimizes download times) when you are publishing a finished web site that will not add new simulations to it. This is because the “common.jar” file varies if you change the simulations on the site and will not be compatible. If you change the simulations, you will need to rebuild the site for all the simulations involved. The option of self-contained JARs creates larger individual JAR files, but they are independent from each other.
It is important to know that Java applets are run by web browsers under security restrictions to protect the user. This implies, for instance, that a normal Java applet cannot access the computer hard disk. For a Java applet to be able to read from or write to the hard disk (as well as to perform other actions) you must “sign the applet”. Google for this sentence to learn what this means and how to sign an applet.
For this option to work correctly, you need to place any auxiliary file (such as GIF images) used by your simulation in the same directory as the source XML file or in a subdirectory of it, and refer relatively to the file in the EJS code. I.e., with its name starting by ‘./’. (As in ‘./MyImage.gif’ or ‘./ASubdirectory/MyImage.gif’.) EJS always refers relatively to files correctly located (i.e. under the same directory as the XML file).
|