Running WebL Programs

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 development kit:

java WebL {options} filename [arg1 arg2 ...]

 

Java Runtime Environment:

jre -cp WebL.jar WebL {options} filename

[arg1 arg2 ...]

 

Java 2 (a.k.a. JDK 1.2) with extension support:

java -jar WebL.jar {options} filename

[arg1 arg2 ...]

 

WebL Command Line Options

Option

Description

-D

Emit casual debugging output.

-Llogfile

Write casual debugging output to a log file.

-C

Print performance counters at end of run.

-P

Wait for ENTER when the program finishes.

Script search path.

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.

Java System Properties

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:

PROPS["user.name"]

 

The following PROPS object gives an idea of what information is accessible from here:

[.

"path.separator" = ";",

"ftpNonProxyHosts" = "*.pa.dec.com",

"http.proxyHost" = "www-proxy1.pa.dec.com",

"http.nonProxyHosts" = "*.pa.dec.com",

"http.proxyPort" = "8080",

"user.language" = "en",

"ftpProxyHost" = "www-proxy.pa.dec.com",

"user.region" = "US",

"ftpProxyPort" = "8080",

"java.vendor" = "Sun Microsystems Inc.",

"file.encoding" = "8859_1",

"line.separator" = "\n",

"file.encoding.pkg" = "sun.io",

"os.name" = "Windws NT",

"user.name" = "marais",

"awt.toolkit" = "sun.awt.windows.WToolkit",

"java.class.version" = "45.3",

"file.separator" = "\",

"http.proxySet" = "true",

"user.timezone" = "PST",

"java.home" = "C:\JAVA",

"java.version" = "11",

"os.arch" = "x86",

"java.vendor.url" = "http://www.sun.com/",

"ftpProxySet" = "false",

"os.version" = "4.0",

"user.dir" = "C:\Proj\WebL3.0\java",

"user.home" = "Z:\marais",

"java.class.path" = "."

.]

 


Up Previous Next