Getting Started With Gosu
At my job, I have the opportunity to learn Guidewire and its Gosu language. The official getting started is a little out of date, referencing JDK 11. Here is how I got Gosu running on my Fedora machine.
SDKMAN can be used to manage multiple versions of Java so you're
not messing with a global install. This is similar to using nvm
or pyenv. To install, see: https://sdkman.io/install/.
Update the SDKMAN configuration to support auto switching by
opening ~/.sdkman/etc/config and setting sdkman_auto_env=true.
With SDKMAN installed, install JDK 11, sdk install java
11.0.30-tem, and install JDK 17, sdk install java 17.0.18-tem. As
of 02/21/2026, 11 is the target JDK for building the Gosu source
code with Maven and 17 appears to be the latest supported JDK for
running Gosu 1.18.x.
I also installed the latest JDK 25, sdk install java 25.0.2-tem
and set that to be the default JDK.
Why the Temurin version of Java and not the others? It's open-sourced, backed by the Eclipse Foundation, and not Oracle. If you're wondering what a temurin is, it is not an animal or creature of any kind. "Temurin" is just an anagram of "runtime".
To install the latest Gosu, download the v1.18.7 source code. If you don't have Maven installed, you will need to get it installed https://maven.apache.org/install.html.
Extract the Gosu source and inside the directory, switch to use
JDK 11: sdk use java 11.0.30-tem. You can verify the correct JDK
version by running: javac --version.
$ javac --version
javac 11.0.30
Run mvn compile and things should build successfully. Run
mvn package to create the Gosu language jar files. Each jar file
will be found under its own package folder and the development
environment will need them all grouped together. Create a "lib"
folder in the source code folder and copy all the packaged jar
files into the lib folder by running: find . -name "*.jar" -type
f -exec cp {} lib \;.
With the libraries compiled, next is the Gosu scripts. Create
a symbolic link in the source code folder to the contents of
gosu/src/main/scripts named "bin": ln -s
gosu/src/main/scripts/ bin. These are scripts that leverage the
libraries.
In a terminal, navigate into the bin folder, switch to JDK 17,
sdk use java 17.0.18-tem, and run ./gosu to launch the lab.
The Gosu lab should launch and run the example Gosu code without
any issue. If Gosu lab hangs or throws an error, make sure you
are running the command in a JDK 17 environment.
With SDKMAN managing the JDK and Gosu built and running, things
are ready for local development. On my machine, I have a
.runtimes folder under my home directory. Inside, I have the
gosu-lang-1.18.7 directory and in my .bashrc file I have added
the bin directory to my PATH variable.
export PATH="$HOME/.runtimes/gosu-lang-1.18.7/bin:$PATH"
$ which gosu
~/.runtimes/gosu-lang-1.18.7/bin/gosu
Now inside your Gosu project directory, initialize the JDK
environment by running: sdk env init. This will create a
".sdkmanrc" file. In order for SDKMAN to use JDK 17, .sdkmanrc
will need to be updated with java=17.0.18-tem.
As you navigate in and out of the folder, SDKMAN will automatically change the JDK version.
$ cd Code/gosu/
Using java version 17.0.18-tem in this shell.
$ cd ..
Restored java version to 25.0.2-tem (default)
$ cd gosu/
Using java version 17.0.18-tem in this shell.
Double check the correct JDK version by running: javac --version.
$ javac --version
javac 17.0.18
You can verify your Gosu setup by creating a hello.gsp file
(.gsp files are Gosu scripting files, .gs for classes and .gsx
for enhancements) with contents print("Hello, World!");. Run
gosu hello.gsp to run the program.
If you are familiar with VS Code and want to use it for Gosu development, there is a VS Code extension available: Gosu Programming Language.
Happy Gosu coding!
-Ben