Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java: Revises DEVELOPER.md file. (#403) #1875

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 34 additions & 21 deletions java/DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ The Valkey GLIDE Java wrapper consists of both Java and Rust code. Rust bindings

### Build from source

**Note:** See the [Troubleshooting](#troubleshooting) section below for possible solutions to problems.

#### Prerequisites

Software Dependencies
**Software Dependencies**

- git
- GCC
Expand All @@ -21,25 +23,6 @@ Software Dependencies
- rustup
- Java 11

**Install protobuf compiler**

To install protobuf for MacOS, run:
```bash
brew install protobuf
# Check that the protobuf compiler version 26.1 or higher is installed
protoc --version
```

For the remaining systems, do the following:
```bash
PB_REL="https://github.com/protocolbuffers/protobuf/releases"
curl -LO $PB_REL/download/v26.1/protoc-26.1-linux-x86_64.zip
unzip protoc-26.1-linux-x86_64.zip -d $HOME/.local
export PATH="$PATH:$HOME/.local/bin"
# Check that the protobuf compiler version 26.1 or higher is installed
protoc --version
```

**Dependencies installation for Ubuntu**

```bash
Expand All @@ -52,6 +35,8 @@ source "$HOME/.cargo/env"
rustc --version
```

Continue with **Install protobuf compiler** below.

**Dependencies installation for CentOS**

```bash
Expand All @@ -60,6 +45,9 @@ sudo yum install -y java-11-openjdk-devel git gcc pkgconfig openssl openssl-deve
# Install rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```

Continue with **Install protobuf compiler** below.

**Dependencies installation for MacOS**

```bash
Expand All @@ -69,6 +57,27 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"
```

Continue with **Install protobuf compiler** below.

**Install protobuf compiler**

To install protobuf for MacOS, run:
```bash
brew install protobuf
# Check that the protobuf compiler version 26.1 or higher is installed
protoc --version
```

For the remaining systems, do the following:
```bash
PB_REL="https://github.com/protocolbuffers/protobuf/releases"
curl -LO $PB_REL/download/v26.1/protoc-26.1-linux-x86_64.zip
unzip protoc-26.1-linux-x86_64.zip -d $HOME/.local
export PATH="$PATH:$HOME/.local/bin"
# Check that the protobuf compiler version 26.1 or higher is installed
protoc --version
```

#### Building and installation steps

Before starting this step, make sure you've installed all software dependencies.
Expand Down Expand Up @@ -151,7 +160,11 @@ For Java, we use Spotless and SpotBugs.
### Troubleshooting

Some troubleshooting issues:
- Failed to find `cargo` after `rustup`: `gradle` daemon may need to be restarted via `./gradlew --stop` to recognize the new `$PATH`. If that doesn't work, you may need to restart your machine.
- 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 `cargo` after `rustup`.
- No Protobuf compiler (protoc) found.
- If build fails because of rust compiler fails, make sure submodules are updated using `git submodule update`.
- If protobuf 26.0 or earlier is detected, upgrade to the latest protobuf release.

Expand Down
Loading