Running a WebL program is highly dependent on the host platform. The WebL classes and resources are bundled in a Java JAR file called WebL.jar. The main class in this JAR file is called WebL.class. The main method of this class needs to be executed with the following arguments:
{options} filename [arg1 arg2 ... ]
The options are summarized in See WebL Command Line Options. The filename argument specifies the name of WebL program to be executed, and arg1, arg2, etc. are the arguments passed to the program. The latter argument list can be accessed from the variable called ARGS inside WebL programs.
The following list gives an indication of how WebL programs can be executed depending on one of several Java installation scenarios:
java WebL {options} filename [arg1 arg2 ...]
jre -cp WebL.jar WebL {options} filename
Java 2 (a.k.a. JDK 1.2) with extension support:
java -jar WebL.jar {options} filename
By default WebL will search for scripts and modules in the current working directory and in the /scripts sub-directory inside the WebL.jar file. The directory search path can be changed by setting a Java system property called "webl.path" to a set of directories. This can be done on the command line with the "D" option:
java -Dwebl.path=dir1;dir2;dir3 WebL ... (Windows)
java -Dwebl.path=dir1:dir2:dir3 WebL ... (Unix)
Note that setting a "webl.path" shell environment variable won't do because environment variables are not accessible from Java applications.
WebL programmers can access the system properties of the underlying Java implementation through a global WebL object called PROPS. For example, to access the user name of the person executing the script, you can write:
The following PROPS object gives an idea of what information is accessible from here:
"ftpNonProxyHosts" = "*.pa.dec.com",
"http.proxyHost" = "www-proxy1.pa.dec.com",
"http.nonProxyHosts" = "*.pa.dec.com",
"ftpProxyHost" = "www-proxy.pa.dec.com",
"java.vendor" = "Sun Microsystems Inc.",
"file.encoding.pkg" = "sun.io",
"awt.toolkit" = "sun.awt.windows.WToolkit",
"java.class.version" = "45.3",
"java.vendor.url" = "http://www.sun.com/",