Houdini 11 HScript commands

Starts a java virtual machine.

Usages

  1. java [-d] [-c classpath] [-d] [-w] [-x] [class]

This command starts up a Java application. It also opens a connection (similar to the openport command) that the Java application can use to communicate with Houdini. In the file $HH/scripts/java/sesi.jar is the definition of a sesi.Houdini class with a single static method called hscript. This method takes a String as an argument which specifies the Houdini scripting command to run. The result of executing the command is returned by this function as a String. A second method, hscriptex, is identical to the hscript method except it will throw a java.io.IOException if there was an error while executing the specified command within Houdini. The directory $HH/scripts/java and the file $HH/scripts/java/sesi.jar are automatically added to the value of the CLASSPATH environment variable.

The class parameter passed to this command specifies the class where Java should begin execution. The specified class must contain a static method called main which takes an array of strings as an argument, and has a void return type.

If the -d option is set, then even when you exit Houdini, the Java application will not be terminated. If the -c option is specified, this command prints out the value of the CLASSPATH variable that is sent to the Java application. The -x option stops all currently running Java applications that were not started with the -d option. If either of the -c or -x options are set, the class parameter becomes optional. If the -w option is set, this command does not return until the new Java application has terminated. The -s option allows the Java application to run only “safe” commands.

Options

-d

Start in daemon mode (even if you exit Houdini, the java application will continue to run).

-c

The CLASSPATH.

-x

Stop all running Java processes that were not started with the -d option.

-w

Wait for the Java process to terminate.

-s

Run the Java code in a sandbox (only “safe” commands allowed, e.g. no access to local disk).

Examples

Java code:

import sesi.Houdini;
public class test {
    public static void main( String args[] ) {
        String oplist = "";
        try {
            oplist = Houdini.hscriptex("opls /");
        } catch ( java.io.IOException e ) {

        }

        Houdini.hscript( "message " + oplist );
    }
}

HScript command:

java -w test

Output: obj out part ch shop img vex

On this page

Replaced by

Related topics