Runner

processing.mode.java.runner

## Class Runner

- Object
- - Runner

- All Implemented Interfaces:
    MessageConsumer

      public class Runner
      extends Object
      implements MessageConsumer

  Runs a compiled sketch. As of release 0136, all sketches are run externally to the environment so that a debugging interface can be used. This opens up future options for a decent debugger, but in the meantime fixes several problems with output and error streams, messages getting lost on Mac OS X, the run/stop buttons not working, libraries not shutting down, exceptions not coming through, exceptions being printed twice, having to force quit if you make a bad while() loop, and so on.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Runner(JavaBuild build, RunnerListener listener)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `void` | `exceptionEvent(ExceptionEvent event)`
    `static boolean` | `handleCommonErrors(String exceptionClass, String message, RunnerListener listener)` Provide more useful explanations of common error messages, perhaps with a short message in the status area, and (if necessary) a longer message in the console.
    `void` | `launch(boolean presenting)`
    `boolean` | `launchVirtualMachine(boolean presenting)`
    `void` | `message(String s)`

    - ### Methods inherited from class Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Runner

          public Runner(JavaBuild build,
                RunnerListener listener)
                 throws SketchException

      Throws:
        `SketchException`

  - ### Method Detail

    - #### launch

          public void launch(boolean presenting)

    - #### launchVirtualMachine

          public boolean launchVirtualMachine(boolean presenting)

    - #### exceptionEvent

          public void exceptionEvent(ExceptionEvent event)

    - #### handleCommonErrors

          public static boolean handleCommonErrors(String exceptionClass,
                                   String message,
                                   RunnerListener listener)

      Provide more useful explanations of common error messages, perhaps with a short message in the status area, and (if necessary) a longer message in the console.
      Parameters:
        `exceptionClass` - Class name causing the error (with full package name)
        `message` - The message from the exception
        `listener` - The Editor or command line interface that's listening for errors
      Returns:
        true if the error was purtified, false otherwise

    - #### close

          public void close()

    - #### message

          public void message(String s)

      Specified by:
        `message` in interface `MessageConsumer`