-
Notifications
You must be signed in to change notification settings - Fork 31
Developer Basics
The following provides basic guidance on how to set up command-line use of nshmp-haz.
- 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.
- Java 8 JDK: Oracle or OpenJDK
-
Git
- Git is included in the macOS developer tools.
- Windows users may want to consider Git for Windows or GitHub Desktop, both of which include a linux-like terminal (Git BASH) in which subsequent commands listed here will work.
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
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.
cd /directory/for/code
git clone https://github.com/usgs/nshmp-haz.git
Eclipse provides automatic compilation, syntax highlighting, and integration with Git, among other useful features. To build or modify nshmp-haz using Eclipse, install:
- Eclipse IDE for Java Developers or Java EE Developers, if you plan on developing web services.
File > Import > Gradle > Existing Gradle Project
Return to: Building & Running
U.S. Geological Survey – National Seismic Hazard Mapping Project (NSHMP)