Build From Source
Prerequisites
Section titled “Prerequisites”Software Dependencies
- git
- GCC
- pkg-config
- cmake
- protoc (protobuf compiler) >= v29.1
- openssl
- openssl-dev
- rustup
- Java 11
- ziglang and zigbuild (for GNU Linux only)
- valkey (for testing)
Valkey installation
Section titled “Valkey installation”See the Valkey installation guide to install the Valkey server and CLI.
Build Instructions
Section titled “Build Instructions”-
Install Common Prerequisites
Section titled “Install Common Prerequisites”Terminal window sudo apt update -ysudo apt install -y git gcc pkg-config openssl libssl-dev unzip cmake python3# Install rustcurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shsource "$HOME/.cargo/env"# Check that the Rust compiler is installedrustc --versionInstall
Section titled “Install ziglang and zigbuild”ziglangandzigbuildTerminal window pip3 install ziglangcargo install --locked cargo-zigbuildTerminal window sudo yum update -ysudo yum install -y git gcc pkgconfig openssl openssl-devel unzip cmake wget tar python3# Install rustcurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shsource "$HOME/.cargo/env"# Check that the Rust compiler is installedrustc --versionInstall
Section titled “Install ziglang and zigbuild”ziglangandzigbuildTerminal window pip3 install ziglangcargo install --locked cargo-zigbuildTerminal window brew updatebrew install git gcc pkgconfig openssl cmake unzip python3# Install rustcurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shsource "$HOME/.cargo/env"# Check that the Rust compiler is installedrustc --versionInstall Protobuf Compiler
Section titled “Install Protobuf Compiler”Terminal window PB_REL="https://github.com/protocolbuffers/protobuf/releases"curl -LO $PB_REL/download/v29.1/protoc-29.1-linux-x86_64.zipunzip protoc-29.1-linux-x86_64.zip -d $HOME/.localexport PATH="$PATH:$HOME/.local/bin"protoc --versionTerminal window PB_REL="https://github.com/protocolbuffers/protobuf/releases"curl -LO $PB_REL/download/v29.1/protoc-29.1-linux-x86_64.zipunzip protoc-29.1-linux-x86_64.zip -d $HOME/.localexport PATH="$PATH:$HOME/.local/bin"protoc --versionTerminal window PB_REL="https://github.com/protocolbuffers/protobuf/releases"curl -LO $PB_REL/download/v29.1//protoc-29.1-osx-universal_binary.zipunzip protoc-29.1-osx-universal_binary.zip -d $HOME/.localexport PATH="$PATH:$HOME/.local/bin"protoc --versionOther platform-specific binaries can be found here.
-
Install JDK 11+
Section titled “Install JDK 11+”Terminal window sudo apt updatesudo apt install -y openjdk-11-jdkTerminal window sudo yum install -y java-11-openjdk-develTerminal window brew install openjdk@11 -
Clone the repository
Section titled “Clone the repository”Terminal window mkdir -p $HOME/srccd $HOME/srcgit clone https://github.com/valkey-io/valkey-glide.gitcd valkey-glide -
Terminal window cd java./gradlew :client:buildAll
Troubleshooting
Section titled “Troubleshooting”Build failures after installation
Section titled “Build failures after installation”If the build fails after following the installation instructions, the gradle daemon may need to be
restarted (./gradlew --stop) so that it recognizes changes to environment variables (e.g. $PATH). If that doesn’t work,
you may need to restart your machine. In particular, this may solve the following problems:
- Failed to find
cargoafterrustup. - No Protobuf compiler (protoc) found.
Protobuf Geneartion failed
Section titled “Protobuf Geneartion failed”> Task :client:compileJava FAILED/Users/Alex.Le/bq/valkey-glide/java/client/src/main/java/glide/models/protobuf/response/ResponseOuterClass.java:9: error: cannot find symbolpublic final class ResponseOuterClass extends com.google.protobuf.GeneratedFile { ^ symbol: class GeneratedFile location: package com.google.protobufThis error indicate that the Protobuf version is incorrect. For Java client, only Protobuf version 29.1.x is supported.
%protoc --versionlibprotoc 29.1