#example-commandline Simple examples of executing Gosu Programs directly from the command line, independent of any IDE or build tools
Java 1.8 installed. A valid JAVA_HOME environment variable to this JRE is recommended.
- Download and extract the latest Gosu release from here.
- Point an environment variable called
GOSU_HOME
to the extracted folder. - Add
$GOSU_HOME/bin
or%GOSU_HOME%\bin
to yourPATH
Evaluate a Gosu expression entirely from the command line:
gosu -e 'print(\"Hello world!\")'
Run a simple Gosu Program with no dependencies or arguments:
gosu simple/HelloWorld.gsp
Run a simple Gosu Program with arguments:
gosu simple/HelloWorldWithArgs.gsp HELO 42 Acceptable!
Run a Gosu Program which imports other Gosu classes:
gosu imports/RunFoo.gsp
Run a simple Gosu Program with a classpath argument:
gosu -classpath "lib/commons-math-2.2.jar" externalDeps/Exponents.gsp