EJSVM(1)                         User Commands                        EJSVM(1)

NAME
       ejsvm - Ejscript Virtual Machine.

SYNOPSIS
       ejsvm  [--class  className]  [--modules  "modules..."]  [--log logSpec]
       [--method methodName] [--search ejsPath] [--version] module  [arguments
       ...]

DESCRIPTION
       The  ejsvm command runs Ejscript programs by loading and executing mod-
       ules previously compiled by the ejsc Ejscript compiler.  The ejsvm com-
       mand  provides a Virtual Machine environment for ejscript programs com-
       plete with class loader, byte code execution,  garbage  collection  and
       core system types.

       If you wish to run Ejscript programs interactively or to parse and exe-
       cute in one-step, use the ejs command shell.

INVOCATION
       The ejsvm command can optionally invoke a  specific  static  method  on
       startup.  If either the --class or --method switches are supplied, then
       ejsvm will run the requested static method after the input modules have
       been loaded and all global scripts have been run.

ORDERING
       The  ejsvm  command  will  load the specified modules and all dependent
       modules. Dependent modules are specified in programs via the use module
       directive.  After that ejsvm will load any additional modules specified
       via the --modules switch including with their dependent modules.  After
       each module and its dependent modules are loaded, the global statements
       of the module will be executed.

OPTIONS
       --class className
              Use the given className when invoking the method  specified  via
              --method.

       --module "module ..."
              Normally modules are loaded automatically by the Ejscript loader
              in response to use module directives in scripts, but you can use
              the  --modules switch to load modules that contain global script
              code outside any module directive.

       --log logName[:logLevel]
              Specify a file to log internal execution messages. Ejs will  log
              execution related trace to the log file. The log level specifies
              the desired verbosity of output. Level 0 is  the  least  verbose
              and  level  9  is  the  most. Level 2 will include trace of each
              source statement and assembler  instruction  executed  (provided
              the source was compiled with --debug).

       ---method methodName
              Set  the  startup method name. Defaults to main if a --className
              is specified and --method is not.

       --search ejsPath
              Set the module search path. The module search path is a  set  of
              directories  that  the  ejsvm command will use when locating and
              loading Ejscript modules.  The search path will always have some
              system  directories  appended  to  the  end. These include paths
              specified via the  EJSPATH environment variable and  key  system
              directories such as the Ejscript system module directory and the
              directory containing the ejsvm command.

              The search path value is similar in format to  the  system  PATH
              variable format.  On windows, path segments are separated by ";"
              and on Linux, Unix, FreeBSD and MAC, the path segments are sepa-
              rated by ":" delimiters.

              Given  a  module  named  "a.b.c" in a script, ejsvm will use the
              following search strategy to locate the module:

              1. Search for a module file named "a.b.c.mod"

              2. Search for a module file named "a/b/c.mod"

              3. Search for a module file named "a.b.c.mod" in the search path

              4. Search for a module file named c.mod in the search path

       --version
              Print the ejsvm command version and exit.

BACKGROUND
       Ejscript  is  an enhanced implementation of the JavaScript language for
       use in embedded applications such as web servers, embedded  and  mobile
       devices.  It  is  especially well suited for Server-Side JavaScript web
       applications.

       Ejscript is a dynamic, interpreted, object-oriented scripting  language
       that supports classes, objects, exceptions, statements, expressions and
       a powerful suite of data types.

REPORTING BUGS
       Report bugs to dev@embedthis.com.

COPYRIGHT
       Copyright (C) 2004-2012 Embedthis Software.  Ejscript is a trademark of
       Embedthis Software.

SEE ALSO
       ejsc, ejsgen, ejs, ejsmod

ejsvm                             March 2012                          EJSVM(1)