Skip to content
jasonbaldridge edited this page Apr 20, 2013 · 1 revision

Requirements

Building the system from source

First, you need to set the environment variable JAVA_HOME to match the top level directory containing the Java installation you want to use.

Nak uses SBT (Simple Build Tool) with a standard directory structure. To build Nak, type the following in the top-level directory of nak.:

$ ./build update compile

This will compile the source files and put them in ./target/classes. If this is your first time running it, you will see messages about Scala being downloaded -- this is fine and expected. Once that is over, the Nak code will be compiled.

To try out other build targets, do:

$ ./build

This will drop you into the SBT interface. To see the actions that are possible, hit the TAB key. One of the more useful ones is doc, which will generate Scaladoc documentation in nak/target/api.

To make sure all the tests pass, do:

$ ./build test

Configuring your environment variables

There is an executable shell script bin/nak which provides commands for using Nak's classes. If you have compiled Nak, you can run bin/nak from the top-level of Nak without doing anything further. If you want to be able to use nak anywhere on your file system, then you must add Nak's bin directory to your path.

The easiest thing to do is to set the environment variable NAK_DIR to the top level directory of Nak and then add the directory NAK_DIR/bin to your path. For example, you can set the path in your .bashrc (or equivalent) file as follows:

export PATH=$PATH:$NAK_DIR/bin
Clone this wiki locally