EJSVM(1) User Commands EJSVM(1) NAME ejsvm - Ejscript Virtual Machine. SYNOPSIS ejsvm [--class className] [--modules "modules..."] [--log logSpec] [--method methodName] [--searchPath ejsPath] [--version] module [argu- ments ...] 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. --searchPath ejsPath Override 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. 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 EJSPATH 4. Search for a module file named c.mod in EJSPATH The search path is initially specified via the environment vari- able EJSPATH and may be overridden via the --searchPath ejsPath switch. EJSPATH and the ejsPath command line value are similar to the system PATH formats. On windows, path segments are sepa- rated by ";" and on Linux, Unix, FreeBSD and MAC, the path seg- ments are separated by ":" delimiters. --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-2009 Embedthis Software. Ejscript is a trademark of Embedthis Software. SEE ALSO ejsc, ejsgen, ejs, ejsmod ejsvm March 2009 EJSVM(1)