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.
jq 1.5 is in the official Fedora repository. Install using
sudo dnf install jq.
jq 1.4 is in the official openSUSE repository. Install using
sudo zypper install jq.
jq 1.5 is in the official Arch repository. Install using
sudo pacman -Sy jq.
Use Homebrew to install jq 1.6 with
brew install jq.
jq 1.6 binary for 64-bit.
jq 1.5 binary for 64-bit.
pkg install jq as root installs a pre-built binary package.
pkgutil -i jq in OpenCSW for Solaris 10+, Sparc and x86.
Use Chocolatey NuGet to install jq 1.5 with
chocolatey install jq.
SHA-256 checksums are provided for all release and pre-release binaries. They can be found under sig/v1.x/sha256sum.txt. The checksums for jq 1.6 are in sig/v1.6/sha256sum.txt. The checksums for jq 1.5 are in sig/v1.5/sha256sum.txt.
Additionally, all binaries are signed by the jq Package Signing Key. The signatures can be found under sig/v1.x/*.asc. The signatures for jq 1.6 are in sig/v1.5/*.asc. The signatures for jq 1.5 are in sig/v1.5/*.asc. You can use GnuPG to verify a signature by downloading the signature and running
gpg --verify signature.asc.
You can build it using the usual
./configure && make && sudo
make install rigmarole.
If you’re interested in using the lastest development version, try:
git clone https://github.com/stedolan/jq.git cd jq autoreconf -i ./configure --disable-maintainer-mode 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.
--disable-maintainer-mode flag says to use the pre-generated lexer and parser that come with the code. To compile the lexer and parser also from source, leave out this flag. You will need to install Flex and Bison.
jq’s documentation is compiled into static HTML using Bonsai. To view the documentation locally, run
rake serve (or
bundle exec rake serve) from the docs/ subdirectory. To build the docs just
rake build from the docs subdirectory. You’ll need a few Ruby dependencies, which can be installed by following the instructions in
The man page is built by
make jq.1, or just
make, also from the YAML docs, and you’ll still need the Ruby dependencies to build the manpage.