Education Prize Logo
Science SPORE Prize
November 2011

NSF Logo
The Open Source Physics Project is supported by NSF DUE-0442581.

EJS Modeling

Overview   -   EJS Overview   -   Installing EJS   -   Running Models   -   Packaging   -   References   -   Find Models

Installing EJS

EJS Console Image

The EJS console runs one or more copies of EJS and shows error messages.

Easy Java Simulations (EJS) is a Java program that can be run under any operating system that supports a Java Virtual Machine (VM). Because Java is designed to be platform independent, the EJS user interface on Microsoft Windows, Macintosh OS X, Unix, and Linux is almost identical.

Do the following to install and run EJS:

  • Install the Java Runtime Environment (JRE) as described in the FAQ.
  • Download the EJS distribution to your computer's disk drive. Unzip this archive into a directory of your choice. This directory contains everything that is needed to run EJS. (See: Easy Java Simulations Modeling and Authoring Tool)
  • Run the EJS console program in the EjsConsole.jar archive as you would any other Java program. Double-clicking on the jar file is usually all that is required. If double-clicking doesn't run the program, open a system terminal window, change to the installation directory, and type the command: java -jar EjsConsole.jar. You may need to fully qualify the java command if it is not in your system's path.

You should see the console (see Figure) on your computer monitor. The console automatically creates an instance of EJS which should appear on your display.

The EJS console is not part of EJS, but a utility used to launch one or several instances (copies) of EJS and to perform other EJS-related tasks. The console is important because it displays EJS program information and error messages.

EJS Installation Directory

The EJS installation directory contains the EjsConsole.jar file that is used to run EJS and three subdirectories named bin, doc, and workspace. The bin and doc directories contain EJS program files and should not be modified. The workspace directory is your working directory and contains the following four important subdirectories:

  • config is the directory for user-defined configuration and options files.
  • export is the proposed target directory for files ready to be distributed.
  • output is the directory used by EJS to place temporary files generated when compiling a simulation.
  • source is the directory under which all simulation (source and auxiliary) files must be located.

EJS creates new files or uses files already in these subdirectories as you run the models, and it is important that you do not delete, move, or rename these subdirectories. (You can, however, organize the contents of export and source directories at your convenience.) You will find additional subdirectories in your source directory which contain sample simulations. In particular, the Modeling Science directory includes the EJS models that are described in book chapters that are available the OSP ComPADRE website. To understand how EJS uses the installation directories, we encourage you to load, inspect, and run a few examples in Modeling Science directory and examine the files that EJS generates in the output and export directories.


The OSP Network:
Open Source Physics - Tracker - EJS Modeling
Physlet Physics
Physlet Quantum Physics