Skip to content

Developer Basics

Peter Powers edited this page Sep 6, 2017 · 17 revisions

The following provides basic guidance on how to set up command-line use of nshmp-haz.

What are Git and GitHub?

  • Git is a distributed version control system (more).
  • GitHub is a public hosting service that facilitates sharing and collaborative development of code and provides a home on the web for documentation and other project resources (more).
  • Git repositories may be created anywhere on your system. Git repositories may be created locally and pushed to Github for sharing, or they may be created on GitHub and pulled down to your local system for editing.

Required Software

Other dependencies are managed with Gradle, which does not require a separate installation. Gradle is clever about finding Java, but some users may have to explicitly define a JAVA_HOME environment variable. For example, on Unix-like systems with bash as the default shell, one might add the following to ~/.bash_profile:

# macOS
export JAVA_HOME="$(/usr/libexec/java_home -v 1.8)"
# Linux
export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_144

On Windows systems, environment variables are set through the System Properties > Advanced > Environment Variables... control panel. Depending on where Java is installed, JAVA_HOME might be:

JAVA_HOME     C:\Program Files\Java\jdk1.8.0_144

Set Up Git

Follow the instructions on GitHub. Some users may find it easier to use Git for Windows or GitHub Desktop, respectively. This installs the components your system requires along with a helpful desktop application for managing communication between local repositories and GitHub, and viewing file diffs as you make changes. Launch the application and perform any configuration steps, using your GitHub username and email address.

Get the Code

cd /directory/for/code
git clone https://github.com/usgs/nshmp-haz.git

Eclipse Integration (Optional)

Eclipse provides automatic compilation, syntax highlighting, and integration with Git, among other useful features. To build or modify nshmp-haz using Eclipse, install:

Return to: Building & Running