Manually building the SDK

Warning

The recommended installation option is to run the SDK as a Docker container.

Java JDK 8

http://www.oracle.com/technetwork/java/javase/downloads/index.html

After downloading and installing the JDK, set your JAVA_HOME environment variable to point to your JDK installation. If you’re not sure where that is, on a Mac, the command /usr/libexec/java_home should tell you and on Linux, readlink -f $(which javac) will provide the installed location of the javac, which you can use to find the base directory of the installation. On a Mac you can set the variable like so:

# for bash
export JAVA_HOME=`/usr/libexec/java_home`
# for tcsh/csh
setenv JAVA_HOME `/usr/libexec/java_home`

You should probably add this command to the end of your ~/.bash_profile or ~/.bashrc file so it is always set when you start a terminal.

Apache Ant

http://ant.apache.org

http://ant.apache.org/manual/install.html

The easiest way to install Ant on a Mac is probably to use a package manager like HomeBrew , which allows you to install simply by brew install ant. Make sure the Ant install location is added to your PATH environment variable, which is generally handled for you if you use a package manager like HomeBrew.

Fetch the code from GitHub:

Create a directory in which you want to work. All your work should go here. All commands that follow are assuming you are using a UNIX shell.

cd <working_dir>
git clone https://github.com/kbase/kb_sdk
cd kb_sdk
make bin  # or "make" to compile from scratch

You should now have the kb-sdk program built in kb_sdk/bin. It will be helpful to add this to your execution path. From within the kb_sdk directory, you can run in Bash:

export PATH=$(pwd)/bin:$PATH

Optionally, you can also install command completion with:

source src/sh/sdk-completion.sh

Like JAVA_HOME, you should consider adding these last two commands to your ~/.bash_profile or ~/.bashrc file so the SDK is always available in the terminal with command completion.

Test installation

To make sure you have built and installed the SDK successfully, type kb-sdk help and kb-sdk version. Check that the version matches that declared in the line in src/java/us/kbase/mobu/ModuleBuilder.java that looks like this:

public static final String VERSION = "1.x.x";