These are the docs for 13.0, an old version of SpatialOS.
The docs for this version are frozen: we do not correct, update or republish them.
14.2 is the newest →
The Java worker SDK is currently experimental.
We’re very open to feedback — don’t hesitate to get in touch on the forums.
Java worker SDK
The Java worker SDK allows anyone to write a worker
in Java to connect to a SpatialOS simulated world. Like any other worker, a Java worker can subscribe to
information for a part of a simulated world, visualize it, and perform some computation on behalf of the
simulated world.
A typical Java worker makes use of both the core API defined in
the improbable.worker package, and Java generated code
based on the user-specified simulated world schema.
If you’re using a game engine we don’t have an integration with, you can use this SDK (or one of the other language
SDKs) to integrate that game engine with SpatialOS. See Integrating an engine
for details.
Download and install the 64-bit JDK 8 for Windows.
You’ll need to install the 1.8.0_65 version or newer. (If you’re using Chocolatey, run choco install –yes jdk8.)
Check it worked by running in a terminal: java -version
Expected output: java version "1.8.0_x"
Add javac to your PATH by following these instructions.
This binary is located in the bin directory inside the JDK installation directory.
Check it worked by running in a terminal: javac -version
Expected output: javac 1.8.0_x
Set the JAVA_HOME system environment variable by following these instructions.
macOS
These instructions assume you’re using Bash.
In a terminal, run:
brew cask install java
Check it worked by running: javac -version
Expected output: javac 1.8.0_x
Determine which configuration file to use: run cd, then ls -a ~
If you have a .bash_profile, that’s your configuration file.
Otherwise, if you have a .bash_login, that’s your configuration file.
Otherwise, if you have a .profile, that’s your configuration file.
If you don’t have any of these files, you can use .bash_profile (which you’ll create in the next step).
Set the JAVA_HOME system environment variable by running: