SDK Setup
The Strategy SDK is what you use to build CryptoStruct strategies. This page covers the contents of the distribution, the toolchain you need, and how to install it on Windows or Linux.
SDK contents
The distribution includes the libraries, command-line tools, documentation, and example projects.
Requirements
Mandatory:
- JDK 25 or a compatible Java Development Kit
- The CryptoStruct Strategy SDK distribution
Recommended:
-
A build system (Maven, Gradle, or Ant) for dependency management and reproducible builds
-
An IDE (IntelliJ IDEA, Eclipse, or equivalent)
-
Version control (Git, SVN, Perforce; not covered here)
Note
The example strategies in the SDK use Maven. The instructions below use OpenJDK 25, Maven, and IntelliJ IDEA. Adapt as needed for your toolchain.
Installation
Windows
-
Download the components
-
Maven: http://maven.apache.org/download.cgi (binary zip archive)
-
Java 25 JDK: https://jdk.java.net/archive/
-
IntelliJ IDEA: https://www.jetbrains.com/idea/download/ (Community Edition)
-
-
Unpack Maven to a directory such as
D:\Users\JohnDoe\Documents\apache-maven-3.8.6. -
Unpack the JDK to a directory such as
D:\Users\JohnDoe\Documents\jdk-25. -
Configure environment variables
JAVA_HOME:D:\Users\JohnDoe\Documents\jdk-25MAVEN_HOME:D:\Users\JohnDoe\Documents\apache-maven-3.8.6
-
Update PATH
PATH=<existing entries>;%JAVA_HOME%\bin;%MAVEN_HOME%\bin; -
Verify the install Open a command prompt and run:
javac --version mvn --versionEach should print version information.
-
Install the Strategy SDK Run
install.cmdfrom the SDK distribution. It installs the strategy-api and strategy-test libraries into the local Maven repository. -
Verify the build Build the example strategy:
- Change into the
simplespreader-strategydirectory - Run
mvn clean install - Confirm that
simplespreader-strategy.jarlands intarget/
- Change into the
-
Set up IntelliJ
- Install IntelliJ IDEA
- Open
simplespreader-strategy/pom.xmlas a new project - Adapt
pom.xmlfor your project
Linux
The commands below assume Ubuntu 20.04. Adapt the package manager calls for your distribution.
-
Download IntelliJ IDEA From https://www.jetbrains.com/idea/download/ (Community Edition).
-
Install OpenJDK 25
sudo apt-get install openjdk-25-jdk -
Install Maven
sudo apt-get install maven -
Install the Strategy SDK Run
install.shfrom the SDK distribution. It installs the strategy-api and strategy-test libraries into the local Maven repository. -
Verify the build Build the example strategy:
- Change into the
simplespreader-strategydirectory - Run
mvn clean install - Confirm that
simplespreader-strategy.jarlands intarget/
- Change into the
-
Set up IntelliJ
- Install IntelliJ IDEA
- Open
simplespreader-strategy/pom.xmlas a new project - Adapt
pom.xmlfor your project
Updating the SDK
You don't need to redo the full setup when updating. Three steps:
-
Install the new SDK libraries Run the install script (
install.cmdon Windows,install.shon Linux) from the new distribution. Versions coexist in the local Maven repository; new installs do not overwrite previous ones. -
Update the project version
If your
pom.xmlhas ansdk.versionproperty:<properties> <sdk.version>4.28.0</sdk.version> </properties>Update it to the new release:
<properties> <sdk.version>4.29.0</sdk.version> </properties> -
Reload the project in your IDE so the new dependency is picked up.
-
Adapt the code as needed. The SDK
CHANGES.mdlists API changes and new features in each release.
Tip
If your project doesn't use the sdk.version property, switch to
property-based versioning as shown below. It makes upgrades a one-line
change.
Version information in the manifest
The Strategy Server reads the strategy and SDK versions from the JAR
manifest. Adding both to the manifest makes deployments traceable.
Configure the Maven JAR plugin in your pom.xml.
Basic configuration
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
<manifestEntries>
<strategyVersion>version-of-your-strategy</strategyVersion>
<sdkVersion>version-of-used-SDK</sdkVersion>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
Recommended: property-based versioning
To keep versions consistent across the build, define them once as Maven properties:
<properties>
<sdk.version>4.28.0</sdk.version>
</properties>
<dependencies>
<dependency>
<groupId>com.cryptostruct</groupId>
<artifactId>strategy-api</artifactId>
<version>${sdk.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
<manifestEntries>
<strategyVersion>${project.version}</strategyVersion>
<sdkVersion>${sdk.version}</sdkVersion>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
This pattern means:
-
The SDK version is defined once and propagates to dependencies and the manifest.
-
The strategy version comes from the Maven project version.
-
Upgrades are a single-line change.
Note
All example projects in the SDK use this pattern. They are the reference implementations to copy from.
If you use a build system other than Maven, adapt the manifest customisation to your tool.