Last updated January 17, 2019 at 4:30PM.

Developing and running NanoDB on Windows is a bit tricky because we depend on a number of tools that are very common on Linux/MacOS, but not so common on Windows. That said, it is mostly straightforward to configure a Windows system to work with NanoDB, as long as you don't attempt to compile it from a terminal window. If you like to work at the terminal it is still doable, but requires a bit more configuration. This document will describe the easier approach of building from IntelliJ IDEA.

Install these packages. The default options should be adequate for your needs.

  1. Install the Oracle Java 11 Development Kit. For the sake of simplicity, choose the ".exe" installer.

    Once you have installed the JDK, you need to make sure it is in the Windows system path, or else programs won't be able to find it. Open up the Windows Control Panel, then choose "System and Security" -> "System", and choose "Advanced system settings" on the left side of the window. This should pop up an additional settings window with a button at the bottom, "Environment Variables...".

    In the bottom half of the window, the System variables are listed. Select the Path variable, then choose "Edit..." This will pop up yet another window that allows you to add a new path to the variable. This should point to the "bin" directory under your Java installation. This will be something like "C:\Program Files\Java\jdk-11.0.2\bin", but you should verify what it is for your specific system, since version numbers will change over time.

    Once you have added the path, you can hit the "OK" buttons to close all of these windows.

  2. Install JetBrains IntelliJ IDEA. Again, it's easiest to choose the ".exe" installer.

  3. Install the Windows Git client. One of the components included in the Windows Git client is "Git Bash," which is a Bash shell that includes some very helpful *NIX utilities.

  4. Install Python 3. For this installation, make sure that you enable the "Add Python 3.x to PATH" check box on the first page of the installer! Besides that, you can choose the "Install Now" option, which should install all components of Python.

Once you have installed these tools, you should be able to build NanoDB from inside IntelliJ IDEA, and run NanoDB from the Git-Bash terminal.

Setting Up Gitlab Access

Before you can checkout the NanoDB codebase, you need to configure an SSH key for access.

  1. Log into Gitlab using your IMSS username and password. After logging in, go to the page that shows your SSH keys.

  2. Start a "Git Bash" prompt on your Windows machine. This prompt will allow you to generate an SSH key in the manner described on the Gitlab SSH key-generation help page.

  3. Generate a new SSH keypair using ssh-keygen:

    ssh-keygen -t rsa -C "[you]@caltech.edu" -b 4096

    Replace "[you]" with your IMSS username.

    You should use the default location for where to store the key-pair.

    Use a long and memorable passphrase, something meaningful to you so it will be easy to remember, but something no one else will be able to guess. For example, maybe a favorite line from a TV show or a movie. If you might forget it then write it down!

  4. Copy the public key contents into the Gitlab page from step 1. You can dump the public key into the console window like this:

    cat .ssh/id_rsa.pub

    Then, select the text and copy/paste it into your Gitlab SSH-key configuration. Save the new key.

  5. Now you should be able to check out your team's repository in the Git Bash terminal!

    git clone git@gitlab.caltech.edu:cs122-19wi/nanodb-team-[yourteam].git

    This will put the cloned git repository into your Windows home directory, e.g. "C:\Users\YourWindowsUsername\nanodb-team-[yourteam]".

You should now be able to import the Git project into IntelliJ IDEA and start developing.

Importing NanoDB into IntelliJ IDEA

Once IntelliJ IDEA is installed, you can go ahead and start up the IDE, then import NanoDB into IntelliJ.

  1. On the main screen, choose "Import Project".

  2. When the file-chooser window pops up, navigate to the local repository that you cloned in the previous section. Again, it will be in your Windows home directory, e.g. "C:\Users\YourWindowsUsername\nanodb-team-[yourteam]".

    Select the directory itself, then hit the "OK" button.

  3. On the next page, choose the option "Import project from external model," and be sure that Maven is selected in the list.

  4. You can accept the defaults and click "Next" for all subsequent pages of the import dialog, but **make sure that Java 11 is selected on the "Please select project SDK" page.

  5. Once you have completed this sequence of steps, you should be ready to start working on NanoDB in IntelliJ. You can expand the "Maven" tab in the upper right part of IntelliJ by clicking on it; then, expand the Lifecycle entry so that you can double-click on e.g. "clean" to perform the clean step, or "package" to build the NanoDB JAR file.

    This will be the easiest way to build the project on Windows.

Running NanoDB from Git Bash

At this point, you should have successfully checked out your team's repository, and you should have successfully built a NanoDB JAR file using IntelliJ IDEA. All you have to do to run it is go back to your Git Bash window, and run "./nanodb" like usual. You should be greeted by the usual prompt, and should be able to type commands, attach the debugger (if you uncomment the debug settings in the script!), and so forth.