jq is written in C and has no runtime dependencies, so it should be possible to build it for nearly any platform. Prebuilt binaries are available for Linux, OS X and Windows.
The binaries should just run, but on OS X and Linux you may need to make them executable first using chmod +x jq.
jq is licensed under the MIT license. For all of the gory details, read the file COPYING in the source distribution.
For Arch users, a PKGBUILD for jq-1.1 is in the AUR, as well as a PKGBUILD for the HEAD of master (jq-git). You can install them using Yaourt or manually by following instructions on Arch Linux’s Wiki.
jq 1.2 is in Debian
brew install jq using homebrew
Or, grab prebuilt 64-bit binaries or 32-bit binaries
You can build it using the usual ./configure && make && sudo
make install rigmarole.
If you’re interested in using the latest development version, try:
git clone https://github.com/stedolan/jq.git
cd jq
autoreconf
./configure
make
sudo make install
To build it from a git clone, you’ll need to install a few packages first:
For Linux systems, these will all be in your system’s package manager, and if you do development on the machine they’re most likely already installed.
On OS X, these are all included in Apple’s command line tools, which can be installed from Xcode. However, you may find that you need a newer version of Bison than the one provided by Apple. This can be found in Homebrew or MacPorts.
flex and bison are used to generate the lexer and parser for jq, and some python scripts generate the UTF8 encoding tables needed for JSON parsing.
jq’s documentation is compiled into static HTML using Bonsai. To view the documentation locally, run rake serve from the docs/ subdirectory. You’ll need a few Ruby dependencies, which can be installed by following the instructions in docs/README.md.