# Installing OR-Tools for Java from Binary on Linux

## Introduction

This guide explains how to install OR-Tools for Java on Linux.

Although these instructions might also work on other Linux variants, we
have only tested them on machines meeting the following requirements:


- Alpine Edge 64-bit (x86_64)
- Centos 7 LTS 64-bit (x86_64)
- Debian SID 64-bit (x86_64)
- Debian 11 (bullseye) 64-bit (x86_64)
- Fedora 38 64-bit (x86_64)
- Fedora 37 64-bit (x86_64)
- OpenSuse Leap 64-bit (x86_64)
- Ubuntu 24.10 64-bit (x86_64)
- Ubuntu 22.04 LTS 64-bit (x86_64)
- Ubuntu 20.04 LTS 64-bit (x86_64)

<br />

> [!NOTE]
> **Note:** OR-Tools only provides archives for the **x86_64** (also known as **amd64**) architecture.

## Prerequisites

The following sections describe the prerequisites for installing OR-Tools.

### Java JDK \>= 8.0

To install the Java JDK version 8.0 or higher, open a terminal window and enter:

### Alpine

    sudo apk add openjdk8
    export JAVA_HOME=/usr/lib/jvm/java-1.8-openjdk

### Centos

    sudo yum install -y java-1.8.0-openjdk java-1.8.0-openjdk-devel

### Debian

    sudo apt install -y default-jdk
    export JAVA_HOME=/usr/lib/jvm/default-java

### Fedora

    sudo dnf install -y java-openjdk java-openjdk-devel

### Fedora

    sudo dnf install -y java-openjdk java-openjdk-devel

### OpenSUSE

    sudo zypper install -y java-1_8_0-openjdk java-1_8_0-openjdk-devel

### Ubuntu

    sudo apt install -y default-jdk

### Ubuntu

    sudo apt install -y default-jdk

### Ubuntu

    sudo apt install -y default-jdk

### Maven \>= 3.3

To install Maven version 3.3 or higher, open a terminal window and enter:

### Alpine

    sudo apk add maven

### Centos

    sudo yum install -y maven

### Debian

    sudo apt install -y maven

### Fedora

    sudo dnf install -y maven

### Fedora

    sudo dnf install -y maven

### OpenSUSE

    sudo zypper install -y maven

### Ubuntu

    sudo apt install -y maven

### Ubuntu

    sudo apt install -y maven

### Ubuntu

    sudo apt install -y maven

You can test Maven is correctly installed and can find java using the following command:

    mvn -v

<br />

## Installing OR-Tools

Take the following steps to install the OR-Tools library for Java:

Download and extract the binary distribution for your system:


- [Almalinux 9](https://github.com/google/or-tools/releases/download/v9.12/or-tools_amd64_almalinux-9_java_v9.12.4544.tar.gz)
- [Alpine Edge](https://github.com/google/or-tools/releases/download/v9.12/or-tools_amd64_alpine-edge_java_v9.12.4544.tar.gz)
- [Debian Sid](https://github.com/google/or-tools/releases/download/v9.12/or-tools_amd64_debian-sid_java_v9.12.4544.tar.gz)
- [Debian 12](https://github.com/google/or-tools/releases/download/v9.12/or-tools_amd64_debian-12_java_v9.12.4544.tar.gz)
- [Debian 11](https://github.com/google/or-tools/releases/download/v9.12/or-tools_amd64_debian-11_java_v9.12.4544.tar.gz)
- [Fedora 41](https://github.com/google/or-tools/releases/download/v9.12/or-tools_amd64_fedora-41_java_v9.12.4544.tar.gz)
- [Fedora 40](https://github.com/google/or-tools/releases/download/v9.12/or-tools_amd64_fedora-40_java_v9.12.4544.tar.gz)
- [OpenSuse Leap](https://github.com/google/or-tools/releases/download/v9.12/or-tools_amd64_opensuse-leap_java_v9.12.4544.tar.gz)
- [Rockylinux 9](https://github.com/google/or-tools/releases/download/v9.12/or-tools_amd64_rockylinux-9_java_v9.12.4544.tar.gz)
- [Ubuntu 24.10](https://github.com/google/or-tools/releases/download/v9.12/or-tools_amd64_ubuntu-24.10_java_v9.12.4544.tar.gz)
- [Ubuntu 24.04 LTS](https://github.com/google/or-tools/releases/download/v9.12/or-tools_amd64_ubuntu-24.04_java_v9.12.4544.tar.gz)
- [Ubuntu 22.04 LTS](https://github.com/google/or-tools/releases/download/v9.12/or-tools_amd64_ubuntu-22.04_java_v9.12.4544.tar.gz)
- [Ubuntu 20.04 LTS](https://github.com/google/or-tools/releases/download/v9.12/or-tools_amd64_ubuntu-20.04_java_v9.12.4544.tar.gz)

<br />

## Validate your installation

To test your Java installations, open a terminal window and navigate to
the directory where you unpacked the binary distribution. Then enter the
following command:


    make test

<br />

This runs a selection of examples for OR-Tools. If all the examples run
successfully, you are ready to
[get started with OR-Tools](https://developers.google.com/optimization/introduction/java).